简体   繁体   中英

When debugging with firebug, no error

I declared global variable in js file which is filled after jquery.ajax call. Everything works fine when I put breakpoint to see if the global variable has its value with Firebug, I can see it, no problem. But when I remove breakpoint and try again, error with variable 'undefined' shows. I also tried to put result into hidden field and then retreive its value later. Same error.

I don't know what is happening? With breakpoint set in Firebug it works fine, without it, shows 'undefined' error.

PS No postbacks are made in these processes.

The symptoms suggest it is a timing issue: when you set the breakpoint, the ajax call has time to 'return', but without it, you are executing code that depends on the ajax call, but it has not returned yet.

That's all I can think of, without having seen the code..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM