언어 설정

Menu
Sites
Language
How can I debug initialization code?

I want to debug the initialization code of a Tizen web application but the Remote Inspector only opens after the initialization code has run.

Is there a way debug initialization code? 

Responses

4 댓글
André Reus

You can use debugger; within your code. If the developer console is open, execution will break. It works in firebug as well.

Reference:

1. https://stackoverflow.com/questions/10050465/set-a-javascript-breakpoint-in-code-in-chrome

2. https://stackoverflow.com/questions/5271465/programmatically-control-breakpoints-in-javascript

Steve Morris

I have tried putting debugger; in a number of places in the code and it does not appear to have any affect.

Steve Morris

Or rather, it only has an effect after the Remote Inspector opens, which is some time after the initialization code has run.

André Reus

hi Steve Morris

Normally i do a simple thing.. that is for debugging purposes i set a click event from home page to start the initialization of the main code.... 


function init(){
// do rest of work.... 
}

var textbox = document.querySelector('.contents');
textbox.addEventListener("click", function(){
    init();       
});

Hope it will help you and solve your problem ..... thanks