有没有办法将表单发布到更多网址?
我需要它在 JavaScript 中..
例如:我有 2 个文档:1.php 和 2.php.. 我希望表单将数据发布到这两个文件,但转到 1.php..
你知道有什么办法吗?
您需要一个带有操作“1.php”和 jQuery 的表单。
$('#form_id').submit(function(event){
event.preventDefault();
var $th = $(this);
$.ajax({
type: 'post',
url: '2.php', // note: edited by Ryan
data: $th.serialize(),
success: function(){
$th.submit();
}
});
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)