Click here to Skip to main content
15,894,307 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
How to see line by line execution of jquery code 
 
I have below code
 
 
$('.edit-mode').hide();
$('.edit-user, .cancel-user').on('click', function () {
var tr = $(this).parents('tr:first');
tr.find('.edit-mode, .display-mode').toggle();
});


What I have tried:

I didn't tryed i don't have any idea
Posted
Updated 28-Sep-16 1:05am
Comments
Suvendu Shekhar Giri 28-Sep-16 6:59am    
Try Firebug on Firefox.

Google "debug javascript" and you'll find some articles, but basically add the debugger statement

debugger;
$('.edit-mode').hide();
$('.edit-user, .cancel-user').on('click', function () {
var tr = $(this).parents('tr:first');
tr.find('.edit-mode, .display-mode').toggle();
});


Make sure you have the browser's dev tools open (usually f12) and when you load the page it will break on the debugger line and the dev tools will let you go line by line as well as inspect variables etc. Exactly how this works differs from browser to browser so google for more specific info.
 
Share this answer
 
Comments
Suvendu Shekhar Giri 28-Sep-16 7:06am    
More relevant answer as per OP's question.
My 5!
You can debug Javascript code using your browsers.
Check following artilces-
1. Internet Explorer
Using the F12 Developer Tools to Debug JavaScript Errors (Windows)[^]
2. Chrome
Debug with Breakpoints | Web Tools - Google Developers[^]
3. Firefox
Debugging JavaScript - Mozilla | MDN[^]
JavaScript Debugger and Profiler : Firebug[^]

Hope, these link helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900