Delay in javascript debugging
开发者_运维知识库I have many linked Javascript files which I need to debug from the point they start executing. I am using the inbuilt debugger in chrome for this purpose. But by the time I am able to open the debugger, the script has already completed the part I want to debug. So, is there a standard way built in chrome (or any other debugger, though I would like to stick to chrome) to stall the execution for debugging. I want to avoid putting a delay like function in my script.
Also, reloading the script is not an option for me.
Set a breakpoint in Developer Tools. When the interpretor gets to that line, it will break, allowing you to examine a few things.
Not the best example, because Stack Overflow's JavaScript is minified, but you get the idea.
just write
function name()
{
debugger;
// you code
}
in you code
精彩评论