Javascript jquery+;ajax-在没有按钮的新选项卡中提交表单后重定向

Javascript jquery+;ajax-在没有按钮的新选项卡中提交表单后重定向,javascript,jquery,ajax,Javascript,Jquery,Ajax,我想在新选项卡中提交我的表格,提交后重定向到另一页。(无需回复) HTML ------- ------ jQuery <script type="text/javascript"> $(function() { $.ajax({ type: $('#myForm').attr('method'), url: $('#myForm').attr('action'), data:

我想在新选项卡中提交我的表格,提交后重定向到另一页。(无需回复)

HTML


-------
------
jQuery

    <script type="text/javascript"> 

    $(function() {
      $.ajax({  
          type: $('#myForm').attr('method'),  
          url: $('#myForm').attr('action'),  
          data: $('#myForm').serialize(),       
          success: function(){  
              alert("success"); 
          //redirect to another page
          }  
      });
    });


</script>

$(函数(){
$.ajax({
类型:$('#myForm').attr('method'),
url:$('#myForm').attr('action'),
数据:$('#myForm')。序列化(),
成功:函数(){
警惕(“成功”);
//重定向到另一页
}  
});
});
我没有扣子。有很多例子,但没有一个适合我

更新:问题是我的表单没有提交。我用来提交数据的表单url,“我的url”是一个支付页面url。

$(函数(){
$(function() {
$.ajax({  
  type: $('#myForm').attr('method'),  
  url: $('#myForm').attr('action'),  
  data: $('#myForm').serialize(),       
  success: function(){  
      alert("success"); 
  //redirect to another page
window.open(
'www.google.com',
'_blank' // <- This is what makes it open in a new tab.
);
}  
});
});
$.ajax({ 类型:$('#myForm').attr('method'), url:$('#myForm').attr('action'), 数据:$('#myForm')。序列化(), 成功:函数(){ 警惕(“成功”); //重定向到另一页 打开窗户( “www.google.com”,
“_blank”//如果成功对您无效,请尝试使用
error

$.ajax({  
  type: $('#myForm').attr('method'),  
  url: $('#myForm').attr('action'),  
  data: $('#myForm').serialize(),       
  success: function(){  
      alert("success"); 
  }
  error: function(e){
      console.log(e);
  }
});

试过了吗?你想如何提交表单,我的意思是什么会让你的表单提交?ie会称之为ajax?现在还不清楚问题出在哪里。ajax调用没有发生吗?是否以某种方式失败?如果不需要响应,新选项卡中需要什么?请查看我的更新,我的表单没有提交。尝试分配正在向表单提交jquery函数。不要忘记默认值!感谢您的回答,请查看我的更新,问题是表单未提交,因此未调用success函数
$.ajax({  
  type: $('#myForm').attr('method'),  
  url: $('#myForm').attr('action'),  
  data: $('#myForm').serialize(),       
  success: function(){  
      alert("success"); 
  }
  error: function(e){
      console.log(e);
  }
});