屏蔽IOS端alert窗口带URL的方法

window.alert = function(name){
var iframe = document.createElement("IFRAME");
iframe.style.display="none";
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
window.frames[0].window.alert(name);
iframe.parentNode.removeChild(iframe);
}

猜你喜欢

转载自www.cnblogs.com/szqtiger/p/12421686.html