3

Can we set a breakpoint in javascript(jquery) code in a asp.net MVC 3 view? I want to debug it because I have to.

I used F12 in IE 9 but no clue.

2 Answers 2

3

Visual Studio doesn't play very nicely with javascript debugging, and neither does IE.

Try using Firefox's Script tab in FireBug, you can set breakpoints there and then refresh or reload the page to hit the breakpoint. It allows step by step execution.

Or in chrome, try going to sources, then with the small icon in the top left of the tab, select the script you want to debug. Clicking on one of the line numbers will set a breakpoint for that item. You will notice that when clicking refresh after doing this there are a few options. Any will do, but a normal refresh works to hit the breakpoint.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use developer tools of your browser.... just press F12 (chrome, ie)

must set the break points on the js source... and play with your page.

I use chrome... Chrome developer tools tutorial

2 Comments

Not js file, it is a fraction of js code in MVC View. It seems to be impossible.
doesn't matter if it's a js file or script on some view, the browser can execute and debug it, on chrome for example, show you the view file like js file because this have a javascript code. impossible nothing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.