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;
   }
});

先打开一个窗口  然后跳转到指定的页面

猜你喜欢

转载自my.oschina.net/u/3559695/blog/1620597