是否可以将表单发布到更多URL?
我在javascript中需要它。
例如:我有2个文档:1.php和2.php ..我希望表单将数据发布到这两个文件中,但请转到1.php。
你知道吗
最佳答案
您需要一个带有 Action “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();
}
});
});