
此代码应该做到这一点。您不需要Form插件来完成以下 *** 作:
$('#create').submit(function() { // catch the form's submit event $.ajax({ // create an AJAX call... data: $(this).serialize(), // get the form data type: $(this).attr('method'), // GET or POST url: $(this).attr('action'), // the file to call success: function(response) { // on success.. $('#created').html(response); // update the DIV } }); return false; // cancel original event to prevent form submitting});欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)