I'm using VS2010. I have javascript visible and I placed a breakpoint in a function like below:
function doShow() {
// $('#save').click(function () {
var product = { ProductName: $('!Response[0]').val(),
UnitPrice: $('#Price').val(),
alert(product);
I placed a breakpoint on the line starting with var and the line starting with Alert. VS2010 accepted the breakpoint and put a small red circle with white center there.
When I run the script the alert shows but it never stops at the breakpoint.
Any ideas what I am doing wrong. note my code is running local
I'm using VS2010. I have javascript visible and I placed a breakpoint in a function like below:
function doShow() {
// $('#save').click(function () {
var product = { ProductName: $('!Response[0]').val(),
UnitPrice: $('#Price').val(),
alert(product);
I placed a breakpoint on the line starting with var and the line starting with Alert. VS2010 accepted the breakpoint and put a small red circle with white center there.
When I run the script the alert shows but it never stops at the breakpoint.
Any ideas what I am doing wrong. note my code is running local
Share Improve this question edited Dec 18, 2011 at 4:31 Joel Coehoorn 416k114 gold badges578 silver badges813 bronze badges asked Apr 22, 2011 at 8:37 Melova1985Melova1985 4072 gold badges5 silver badges5 bronze badges3 Answers
Reset to default 3Install the Firebug add-on for Firefox. It will allow you to do all kinds of Javascript (and other) debugging, inside the browser.
A technique you can use to debug JavaScript using Visual Studio is to add this code to your JavaScript and then run your page in IE.
debugger;
The best way that I've found to debug JavaScript is to use the built in developer tools found in IE9 and Chrome (or Firebug in Firefox as mentioned in this discussion). Since JavaScript is a client-side language, I'm not sure that Visual Studio will have access.
Resources on using JavaScript Debuggers:
- Using Firebug
- Discussion on using the Chrome Debugger
Edit: As indicated below, you can use Visual Studio with IE.