window.open被浏览器拦截的解决方案

function newWin(url, id) {
              var a = document.createElement('a');
              a.setAttribute('href', url);
              a.setAttribute('target', '_blank');
              a.setAttribute('id', id);
              // 防止反复添加
              if(!document.getElementById(id)) document.body.appendChild(a);
              a.click();
  }

http://zakwu.me/2015/03/03/dan-chu-chuang-kou-bei-liu-lan-qi-lan-jie-de-jie-jue-fang-an/

原文地址:https://www.cnblogs.com/hupan508/p/7029479.html