admin管理员组文章数量:1180406
I have a form and I am using Javascript to validate the form so if you leave a field blank it will alert "Please fill in your Name".
If I go to the link directly, it works perfectly. But this is kind of like a Widget so I am using an iFrame to embed it into other sites. When I embed it, and click Submit with an empty field it says: The page at says: Please fill in your name
Is there a way to get rid of that?
I have a form and I am using Javascript to validate the form so if you leave a field blank it will alert "Please fill in your Name".
If I go to the link directly, it works perfectly. But this is kind of like a Widget so I am using an iFrame to embed it into other sites. When I embed it, and click Submit with an empty field it says: The page at http://www.example.com says: Please fill in your name
Is there a way to get rid of that?
Share Improve this question edited May 2, 2015 at 8:22 bummi 27.4k14 gold badges65 silver badges104 bronze badges asked Nov 3, 2011 at 14:42 DrewDrew 6,86219 gold badges65 silver badges97 bronze badges 2- 3 It's a security measure, to prevent a malicious iframe from tricking you into thinking that the parent page is requesting private information. – Marc B Commented Nov 3, 2011 at 14:44
- possible duplicate of How to edit a JavaScript alert box title? – Juri Commented Nov 3, 2011 at 14:44
3 Answers
Reset to default 26No, 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/
本文标签: iframeJavascript AlertRemoving quotThe page atSaysquotStack Overflow
版权声明:本文标题:iframe - Javascript Alert - Removing "The page at ??? Says" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738110374a2064516.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论