Javascript Alert - Removing “The page at ??? Says”

瘦欲@ 提交于 2019-12-05 05:46:09

No, there isn't. It is an anti-phishing feature.

If you want a dialog without it, then you have to fake it using HTML elements in your page.

For those who are still looking to use the native alert/confirm, it's not that hard to get past the anti-phishing implementation. This is because the iframe can edit the parent and access it's scope.

Try this:

parent._alert = new parent.Function("alert(arguments[0]);");
parent._alert('Test!');

The reason this works is because new Function('') does not create a closure and instead uses the scope of where Function is defined (via parent.Function).

You can use some custom alert plugin. For example http://stefangabos.ro/jquery/zebra-dialog/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!