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.
2 Answers
You can use following to debug javaScript
- Put
breakpointinside javascript. Using VS2010 you can debug the javascript. You will need to enable javascript debugging in IE by unchecking both of theDisable script debuggingfrom IE => Options => Advanced. - Use
console.logto log the messages from javaScript
Hope this info helps you.
6 Comments
SkonJeet
Thanks for your reply Amar. My question is more specific to visual studio though I feel - I simply cannot set a breakpoint anywhere in the javascript (clicking does nothing) on occasions, and then at other times I can set breakpoints without a problem!? Thanks.
Amar Palsapure
Not sure about this but, in such cases try putting
breakpoint keyword in the javascript. I have never faced such issue so far (lucky me).SkonJeet
I've had a quick look around and using the debugger keyword will do me for now. Thanks Amar.
Amar Palsapure
Great some break through finally.
Philo
what about while using Safari and Firefox and Chrome?
|