SkonJeet
SkonJeet

Reputation: 4905

ASP .net - debugging javascript (quick breakpoints issue)

Sometimes I can set breakpoints in my javascript, sometimes I can't - why is this? I can't seem to find whatever it is that would determine whether I can debug it or not. I know I can debug the dynamic page, but occasionally I'll be able to set breakpoints in my original code.

Upvotes: 0

Views: 2437

Answers (2)

Joseph
Joseph

Reputation: 11

Try this:

--javascript code......

debugger; // stops execution and can start debugging

--javascript code......

Upvotes: 1

Amar Palsapure
Amar Palsapure

Reputation: 9680

You can use following to debug javaScript

  • Put breakpoint inside javascript. Using VS2010 you can debug the javascript. You will need to enable javascript debugging in IE by unchecking both of the Disable script debugging from IE => Options => Advanced.
  • Use console.log to log the messages from javaScript

Hope this info helps you.

Upvotes: 3

Related Questions