使用iframe链接将iframe重定向到父窗口

时间:2014-05-21 13:40:31

标签: javascript jquery iframe

我正在使用我正在使用的平台自动生成数据,因此我无法直接访问Iframes链接。所以我试图做的是编写一个脚本,获取Iframe中的链接,然后使用该链接重定向父页面。

这是我正在使用/试图实现的脚本,我无法看到我做错了什么:

<script>
    function replaceLoad(oIframe) {
        oIframe.onload = function () {
            document.getElementById("replaceLoad").contentWindow.location = "javascript:moveMe()"
        }
    }
</script>

这是iframe html:

<iframe scrolling="no" src="http://www.discoverhomefinder.com/dljones/homes-for-sale/AZ/Anthem?wmode=opaque" frameborder="0" style="border: 0px none; margin-left: 0px; height: 3900px; margin-top: -12%; width: 100%;" onload="replaceLoad(this)">
</iframe>

如果有人对我做错了什么有任何见解,这就是我的头!

谢谢!

0 个答案:

没有答案
相关问题