检测iFrame中的网址是否已更改 [英] Detect if the url in an iFrame has changed

查看:121
本文介绍了检测iFrame中的网址是否已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果iframe与父网页不在同一个域中,是否有用户点击iframe内部的链接?

Is there anyway to detect if a user clicks a link inside of an iframe if the iframe is not on the same domain as the parent page?

编辑:我无权访问iframed页面。我只拥有父窗口。

I don't have access to the iframed page. I only own the parent window.

推荐答案

没有。由于javascript同源政策,如果iframe不是与您运行javascript的网页所在的域相同,则无法访问iframe DOM的任何成员。

No. Due to the javascript same-origin policy, you cannot access any members of the iframe's DOM if the iframe did not serve from the same domain as the page on which your javascript is running.

这篇关于检测iFrame中的网址是否已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆