[英]jQuery prevent multiple ajax calls
我在通过ajax加载的网页中具有<a>
元素:
<div class="small-box bg-aqua">
<div class="inner">
<div class="col-xs-4 text-center">
<h2>___</h2>
<p>____</p>
<ul class="list-unstyled">
<li>
<i class="fa fa-building"></i>
<strong> Address</strong>: -
</li>
<li>
<i class="fa fa-phone"></i>
<strong> Phone #</strong>: -
</li>
</ul>
</div>
<a id="corp1" class="small-box-footer" href="1">
More info
<i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
以下脚本将使<a>
元素执行ajax调用
$('body').on('click', 'a[id^="corp"]', function(e) {
call_master('corporate/get_detail', $(this).attr('href'));
e.preventDefault();
});
我该如何解决?
用$('body').one()
更改$('body').on()
,问题解决了,谢谢大家_ :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.