user1108948
user1108948

Reputation:

debug javascript in MVC 3 View

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.

Upvotes: 3

Views: 6384

Answers (2)

Zach dev
Zach dev

Reputation: 1620

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

Upvotes: 1

Travis J
Travis J

Reputation: 82287

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.

Upvotes: 3

Related Questions