您的位置:首页 > Web前端 > JQuery

jquery阻止默认submit,改用异步提交

2013-04-03 16:43 295 查看
/article/4667125.html
$(document).ready(function () {//wire up to the form submit event$("form.hijax").submit(function (event) {event.preventDefault();  //prevent the actual form posthijack(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});}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐