Debugging JQuery With WebService Calls
How do you debug jquery code as well as hit breakpoints on web services from ajax jquery calls to a web service in visual studio 2008
This is probably easy, but all I can figure out is setting alert boxes in the jquery code which barely helps and I have no idea to find out if the jquery is even hitting the web servi开发者_如何学JAVAce method, nor do I know if the service is running correctly. Can I set breakpoints like in normal server side code in visual studio and step through this stuff?
I tried using firebug for the jquery, but I cannot get exceptions or watch variables in it.
Firebug allows you to set breakpoints for your JavaScript (jQuery, in this case). You can place it anywhere within the script (with some minor limitations) and when you hit that breakpoint, you should be able to start tracing through the process. (In addition, Firebug has a huge amount of capabilities - you can see network traffic, page layout, inspect the DOM, etc, etc. Extremely useful tool.)
On the backend, you will also place breakpoints in your source code in Visual Studio. As long as you're using the Visual Studio development web server (which is selected by default) and you are running debug mode, you will also hit the breakpoint whenever you hit the web service (assuming, of course, that you are actually getting to that breakpoint in your code).
精彩评论