手机页面alert弹出框有url咋办

来源:互联网 发布:全速网络办公 编辑:程序博客网 时间:2024/04/28 16:07

在script中加入如下代码

window.alert = function(name){ // 重写alert方法去掉ios下alert带的url        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); }
原创粉丝点击