admin管理员组文章数量:1336660
I have a page where I'm displaying iframes. The iframes are on the same domain with the website so I can edit and read the content of it, but I can't edit the source code of the iframes, because I don't have access to the file itself. The iframes are alerting a message and I want to disable this. I want to disable the dialog boxes at least for myself, I`m using chrome...
Is this possible without disabling javascript ? Or could I disable javascript only inside the iframes ?
I have a page where I'm displaying iframes. The iframes are on the same domain with the website so I can edit and read the content of it, but I can't edit the source code of the iframes, because I don't have access to the file itself. The iframes are alerting a message and I want to disable this. I want to disable the dialog boxes at least for myself, I`m using chrome...
Is this possible without disabling javascript ? Or could I disable javascript only inside the iframes ?
Share Improve this question edited Jul 19, 2011 at 15:02 pimvdb 155k80 gold badges311 silver badges356 bronze badges asked Jul 13, 2011 at 0:31 CsabiCsabi 64111 silver badges20 bronze badges1 Answer
Reset to default 7What about:
window.frames[0].alert = function() {};
It overwrites the alert function inside the first iframe with a function that does nothing, hence all alert(...)
calls called there result in nothing happening.
As for subsequent iframes, you'd need to change 0
into 1
etc.
本文标签: javascriptHow to disable dialog boxesalert()Stack Overflow
版权声明:本文标题:javascript - How to disable dialog boxes - alert()? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742421600a2471767.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论