iframe内容无法从不同域中的页面访问(Iframe contents not accessible from a page in different domain)

系统教程 行业动态 更新时间:2024-06-14 17:02:18
iframe内容无法从不同域中的页面访问(Iframe contents not accessible from a page in different domain)

需要来自JavaScript大师的帮助。

我有一个http://www.google.com/finance/converter嵌入在IFrame中的页面。 每次Google财经页面加载时,我都可以收到活动通知。 现在问题是这个页面的内容不能通过JavaScript访问。 这似乎是一些安全问题(通知萤火虫)。 是否有任何解决方法,以便我可以访问使用JavaScript的值(结果和选择框)?

I am using .. function iframe_loaded(){ $("#frame").contents().find("select"); // returns 0 elements }

Need some help from javascript gurus.

I have one page where http://www.google.com/finance/converter is embedded inside IFrame. I am able to get the event notification whenever Google Finance page loads. Now problem is this that contents of this page is not accessible through javascript. It seems to be some security issue (firebug notified). Is there any workaround so that I can access values (result and select boxes) using javascript?

I am using .. function iframe_loaded(){ $("#frame").contents().find("select"); // returns 0 elements }

最满意答案

不,没有。 想象一下这个的安全含义。 黑客网站包含您的银行网站的iframe,并在输入字段中注册一个键盘事件处理程序,您可以在其中输入信用卡号码,以获取您在该处输入的所有内容。

No there isn't. Imagine the security implications of this. A hacker site includes an iframe of your bank site and registers a keyup event handler for the input field where you type your credit card number capturing everything you type there.

更多推荐

本文发布于:2023-04-21 18:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/1f61c94a98a981976bfc6a65d24b5192.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   内容   Iframe   iframe   page

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!