jQuery .load()函数只被调用一次 [英] jQuery .load() function only gets called once

查看:512
本文介绍了jQuery .load()函数只被调用一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

##### SOLVED #####
我有一个javaScript刷新setInterval(...,1000);在源代码中导致错误。非常感谢您的帮助!

##### SOLVED ##### I had a javaScript refresh setInterval("...", 1000); in the source code which caused the error. Thanks a lot for your help!

html

<div class="stackwrapper" id="user1"></div>
<div class="stackwrapper" id="user2"></div>
<div class="userdrawings"></div>

javascript

the javascript

$('.stackwrapper').click(function(e){
var id=$(this).attr('id');
$('.userdrawings').load('loadSession.php?user='+id).fadeIn("slow");
});

不知为什么它只能工作在第一次点击stackwrapper,当我点击第二一个,该函数不会再次触发。

Somehow it only works at once, only at the first click on stackwrapper, when I click on the second one, the function is not triggered again.

推荐答案

好吧,现在我得到它,这是因为你正在进行ajax调用。这是 链接 ,可以回答您的问题。

Okay now i get it, it's because you're making ajax call. Here's a link that answers your question.

这篇关于jQuery .load()函数只被调用一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆