解决弹出的窗口window.open会被浏览器阻止的问题

来源:互联网 发布:胡彦斌人品怎么样知乎 编辑:程序博客网 时间:2024/05/16 11:32
function openwin(url) {
    var document.createElement_x("a");
    a.setAttribute("href", url);
    a.setAttribute("target", "_blank");
    a.setAttribute("id", "openwin");
    document.body.appendChild(a);
    a.click();
}
原创粉丝点击