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

时间:2014-05-22 17:24:05

标签: javascript iframe

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

所有内容都位于同一个域中我无法编辑自动生成数据的页面,因此我使用的是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 个答案:

没有答案
相关问题