h5頁面內嵌到微信公眾號提示信息alert的時候會顯示域名,去掉域名顯示重寫alert方法:
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);
};
————————————————
版權聲明:本文為CSDN博主「Zxiuping」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/Zxiuping/article/details/90404271