我是靠谱客的博主 大意鸡,这篇文章主要介绍jquery阻止默认submit,改用异步提交,现在分享给大家,希望可以做个参考。

http://www.cnblogs.com/zhuqil/archive/2010/07/18/1780285.html  

$(document).ready(function () {
//wire up to the form submit event
$("form.hijax").submit(function (event) {
event.preventDefault();
//prevent the actual form post
hijack(this, update_sessions, "html");
});
});
function hijack(form, callback, format) {
$("#indicator").show();
$.ajax({
url: form.action,
type: form.method,
dataType: format,
data: $(form).serialize(),
completed: $("#indicator").hide(),
success: callback
});
}

最后

以上就是大意鸡最近收集整理的关于jquery阻止默认submit,改用异步提交的全部内容,更多相关jquery阻止默认submit内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(111)

评论列表共有 0 条评论

立即
投稿
返回
顶部