为什么jQuery并不总是加载?(How come jQuery doesn't always load?)

编程入门 行业动态 更新时间:2024-10-27 05:28:06
为什么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.

更多推荐

本文发布于:2023-08-04 10:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1414118.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   jQuery   load

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!