首页 > 编程语言 > 详细

Javascript:使用jQuery提交Form表单

时间:2014-09-28 10:09:42      阅读:215      评论:0      收藏:0      [点我收藏+]

DEMO说明一切:

 1 // this is the id of the form
 2 $("#idForm").submit(function() {
 3  
 4    var url = "path/to/your/script.php"; // the script where you handle the form input.
 5  
 6     $.ajax({
 7            type: "POST",
 8            url: url,
 9            data: $("#idForm").serialize(), // serializes the form‘s elements.
10            success: function(data)
11            {
12                alert(data); // show response from the php script.
13            }
14          });
15  
16     return false; // avoid to execute the actual submit of the form.
17 });

 

Javascript:使用jQuery提交Form表单

原文:http://www.cnblogs.com/ilovewindy/p/3988833.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!