jQuery-给定形式.如何绑定以在提交成功,ajax成功后发出警报 [英] jQuery - given a form. How to bind to alert AFTER the submit, ajax success
本文介绍了jQuery-给定形式.如何绑定以在提交成功,ajax成功后发出警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用jQuery,是否可以将成功事件绑定到实际$ .ajax之外的特定形式,并且以不绑定到所有ajax调用的方式来实现呢?
w jQuery is it possible to bind a success event to a particular form outside of the actual $.ajax, and in a way that doesn't bind to all ajax calls just the one in particular?
推荐答案
按正常定义函数并仅传递名称
Define the function as normal and just pass the name
示例
<script>
function submitSuccess(data)
{
}
$.ajax({
....
success: submitSuccess,
...
});
</script>
这篇关于jQuery-给定形式.如何绑定以在提交成功,ajax成功后发出警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文