javascript - How to disable dialog boxes - alert()? - Stack Overflow

I have a page where I'm displaying iframes. The iframes are on the same domain with the website so

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 badges
Add a ment  | 

1 Answer 1

Reset to default 7

What 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742421600a4440792.html

相关推荐

  • javascript - How to disable dialog boxes - alert()? - Stack Overflow

    I have a page where I'm displaying iframes. The iframes are on the same domain with the website so

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信