现在的位置: 首页 > 综合 > 正文

解决弹出的窗口window.open会被浏览器阻止的问题(自定义open方法)

2018年08月18日 ⁄ 综合 ⁄ 共 218字 ⁄ 字号 评论关闭

function openwin(url) {
    
var a = document.createElement("a");
    a.setAttribute(
"href", url);
    a.setAttribute(
"target""_blank");
    a.setAttribute(
"id""openwin");
    document.body.appendChild(a);
    a.click();
}

抱歉!评论已关闭.