alert弹出框显示域名问题

it2022-05-06  12

最近在开发Hybrid APP时发现用系统默认的alert弹出框总会带有域名,用户体验就比较不好了。想了一种办法来解决就是覆盖alert的方法。

(function(){       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);}  })();

完美解决!

转载于:https://www.cnblogs.com/ydam/p/9207378.html

相关资源:DirectX修复工具V4.0增强版

最新回复(0)