0
在我的应用程序正在使用产生以下标记插件:处理成功的表单提交使用jQuery
<form id="addCommentForm"
action="/foo/add"
method="post"
onsubmit="
jQuery.ajax({type:'POST', data:jQuery(this).serialize(),
url:'/foo/add',
success:function(data,textStatus) {
jQuery('#comments').html(data);
},
});
return false">
<!-- form elements here -->
</form>
当表单提交成功我想通过定义成功处理后做别的事情插件,说alert('hello');
。
我之所以苦苦挣扎,是因为我不能将我的代码添加到上面成功处理程序的末尾,因为这段代码不在我的控制之下。
我查找了一个表单事件,该表单事件在onsubmit
之后执行,我可以附加我的代码,但没有找到任何东西。
除了ajaxSuccess http://api.jquery.com/category/ajax/global-ajax-event-handlers/全系列ajax方法 – charlietfl 2012-03-06 17:31:52