/**
* 在用户触发操作后回调该函数即可跳转
* @param {Object} url 需要跳转的连接
* @param {Object} id 元素id
*/
function windowOpen(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();
a.remove();
}
window.open被拦截的解决方案
最新推荐文章于 2024-06-25 17:42:50 发布