confirm 和 alert不显示ip改写
生活随笔
收集整理的這篇文章主要介紹了
confirm 和 alert不显示ip改写
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//重寫 alert 不顯示ip地址window.alert = function alertw(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);}//重寫confirm 不顯示ip地址var wConfirm = window.confirm;window.confirm = function (message) {try {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 iwindow = alertFrame.window;if (iwindow == undefined) {iwindow = alertFrame.contentWindow;}var result = iwindow.confirm(message);iframe.parentNode.removeChild(iframe);return result;}catch (exc) {return wConfirm(message);}}
總結
以上是生活随笔為你收集整理的confirm 和 alert不显示ip改写的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 苹果CMS内容管理系统 - 苹果CMS官
- 下一篇: 如何做一名合格的管理者?