安卓手机默认弹窗是标题是没有网址的,但是苹果手机弹窗会出现网址,解决方案是添加js达到兼容效果alert、confirm

如下

window.alert = function(name){

var iframe = document.createElement("IFRAME");

iframe.style.display="none";

document.documentElement.appendChild(iframe);

window.frames[0].window.alert(name);

iframe.parentNode.removeChild(iframe)

}

window.confirm = function (message) {

var iframe = document.createElement("IFRAME");

iframe.style.display = "none";

iframe.setAttribute("src", 'data:text/plain,');

document.documentElement.appendChild(iframe);

var alertFrame = window.frames[0];

var result = alertFrame.window.confirm(message);

iframe.parentNode.removeChild(iframe);

return result;

}