JQuery ajax api表单提交
来源:互联网 发布:千牛软件 编辑:程序博客网 时间:2024/05/18 20:04
jquery ajax api,表单提交方法一:
// this is the id of the submit button
$("#submitButtonId").click(function() {
var url = "path/to/your/script.php"; // the script where you handle the form input.
$.ajax({
type: "POST",
url: url,
data: $("#idForm").serialize(), // serializes the form's elements.
success: function(data)
{
alert(data); // show response from the php script.
}
});
return false; // avoid to execute the actual submit of the form.
});
表单提交方法二:
<form id="contactForm1" action="/your_url" method="post">
...
</form>
<script type="text/javascript">
var frm = $('#contactForm1');
frm.submit(function () {
$.ajax({
type: frm.attr('method'),
url: frm.attr('action'),
data: frm.serialize(),
success: function (data) {
alert('ok');
}
});
return false;
});
</script>
- JQuery ajax api表单提交
- jQuery+aJax表单提交
- Jquery ajax 表单提交
- jquery ajax 提交表单
- jquery ajax 提交表单
- jquery ajax 提交表单
- jQuery Ajax提交表单
- jquery ajax提交表单
- Jquery ajax 提交表单
- jQuery-AJAX提交表单
- jquery ajax表单提交插件
- Jquery ajax 提交表单Demo
- jquery ajax直接提交表单
- Jquery ajax 提交表单Demo
- jQuery ajax提交form表单
- Jquery Ajax提交form表单
- jquery使用ajax提交表单
- 使用jQuery ajax提交表单
- C#输出杨辉三角形
- 什么是far、near关键字
- XCode4导入外部Library工程
- 自定义Flex事件,实现组件间传递事件
- 开心网做即时通讯就是在自寻死路!
- JQuery ajax api表单提交
- 黑马程序员_C#基础回顾
- linux编程中遇到的Segmentation fault错误
- FileUpload控件
- codeforces 174B File List 字符串 trick
- throws 和 throw 的区别
- 内存的中段
- 字符串加密
- Asp.net TreeView来构建用户选择输入的方法