ajax後 使用window.open() 瀏覽器出現攔截的解決辦法

//瀏覽器攔截window.open解決方法
var newTab=window.open('about:blank');
$.ajax({
   type: "POST",
   url: "/wb/queryOrder/isQueryOrderCode",
   data: {
      queryPhone:queryPhone,
      queryOrderCode:queryOrderCode
   },
   datatype: "json",
   success: function(data) {

      if(data.code==200){
         newTab.location.href="http://www.baidu.com";
      }else{
         alert(data.desc);
         return;
      }
   },
   error: function() {
      return;
   }
});

先打開一個窗口  而後跳轉到指定的頁面ajax

相關文章
相關標籤/搜索