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

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-07-26
  • 2022-01-22
  • 2021-06-25
  • 2022-12-23
  • 2022-01-17
猜你喜欢
  • 2021-11-29
  • 2021-12-06
  • 2021-12-08
  • 2021-11-25
  • 2022-01-06
  • 2021-12-24
  • 2021-11-23
相关资源
相似解决方案