简体   繁体   English

使用Firebug进行调试时,没有错误

[英]When debugging with firebug, no error

I declared global variable in js file which is filled after jquery.ajax call. 我在js文件中声明了全局变量,该文件在jquery.ajax调用后填充。 Everything works fine when I put breakpoint to see if the global variable has its value with Firebug, I can see it, no problem. 当我放置断点以查看全局变量在Firebug中是否具有其值时,一切工作正常,我可以看到,没问题。 But when I remove breakpoint and try again, error with variable 'undefined' shows. 但是,当我删除断点并重试时,显示变量'undefined'的错误。 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. 在Firebug中设置断点后,它可以很好地工作,没有它,则显示“未定义”错误。

PS No postbacks are made in these processes. PS在这些过程中不进行回发。

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. 症状表明这是一个定时问题:设置断点时,ajax调用有时间“返回”,但没有断点,您正在执行依赖于ajax调用的代码,但尚未返回。

That's all I can think of, without having seen the code.. 我只要不看代码就可以想到的所有内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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