欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

IOS微信端confirm以及alert去掉網(wǎng)址的實(shí)例代碼

 更新時(shí)間:2018年01月22日 13:52:40   作者:萬一火了  
下面小編就為大家分享一篇IOS微信端confirm以及alert去掉網(wǎng)址的實(shí)例代碼,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

在做微信公眾號(hào)開發(fā)時(shí)IOS端的微信瀏覽器打開,觸發(fā)confirm以及alert時(shí)彈出框會(huì)有附帶當(dāng)前網(wǎng)址信息,Android端的沒有測(cè)試,不知道是否有同樣的情況。

解決辦法如下:

“`
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); }; 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; }; alert('abc'); confirm('are you sure?');
“`

以上這篇IOS微信端confirm以及alert去掉網(wǎng)址的實(shí)例代碼就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論