解决弹出的窗口window.open会被浏览器阻止的问题
方法-: 在js中不采用window.open方法,采用window.location.href = url;
方法二:自定义方法:
function openwin(url) {
var a = document.createElement_x("a");
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
a.setAttribute("id", "openwin");
document.body.appendChild(a);
a.click();
}
var a = document.createElement_x("a");
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
a.setAttribute("id", "openwin");
document.body.appendChild(a);
a.click();
}