为什么jQuery并不总是加载?(How come jQuery doesn't always load?)
在我的代码中,我有:
$(document).ready(function() { $.ajaxSetup ({ // Disable caching of AJAX responses */ cache: false }); //pop_i = setInterval( "load_result()", 1000 ); load_result(); load_f(); });但它并不总是加载。 我知道这是因为load_f()有一个警报,有时不会触发。
In my code, I have:
$(document).ready(function() { $.ajaxSetup ({ // Disable caching of AJAX responses */ cache: false }); //pop_i = setInterval( "load_result()", 1000 ); load_result(); load_f(); });but it doesn't always load. I know this because load_f() has an alert which doesn't get triggered sometimes.
最满意答案
如果您确定您的JavaScript看起来正确并且您没有在Firebug中收到任何错误,那么可能是从服务器发回的JSON正在绊倒。
load_f无法运行的地方将来自Firebug的GET / POST请求的结果复制粘贴到文本编辑器中,并使用细齿梳理它们以确保JSON格式正确。
If you are sure your JavaScript looks right and you're not getting any errors in Firebug, chances are it's the JSON being sent back from the server that's tripping things up.
Where load_f fails to run copy-paste the result of your GET/POST requests from Firebug into your text-editor and pour through them with a fine-tooth comb to make sure the JSON is well-formed.
更多推荐
发布评论