Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何设置另一个iframe的元素?_Javascript_Iframe - Fatal编程技术网

Javascript 如何设置另一个iframe的元素?

Javascript 如何设置另一个iframe的元素?,javascript,iframe,Javascript,Iframe,我试图将元素从一个iframe设置到另一个iframe window.iframes["test"].document.getElementById('lDownload').setAttribute('target',"_blank") //document.getElementById('lDownload').setAttribute('target',"_blank") window.iframes["test"].document.get

我试图将元素从一个iframe设置到另一个iframe

window.iframes["test"].document.getElementById('lDownload').setAttribute('target',"_blank")
            //document.getElementById('lDownload').setAttribute('target',"_blank")
            window.iframes["test"].document.getElementById('lDownload').setAttribute('href',downloadFilename)
        }
        else
        {
            //noProcess();
            window.frames["test"].document.getElementById('lDownload').setAttribute('href',"javascript:noProcess()")                
        }
--引用iframe javascript/document parent.frames(“test”).yourIframeFunction()

parent.frames[0].yourIframeFunction()

--引用父/顶文档的javascript/文档 parent.yourMainDocumentFunction()

--重新加载iframe内容
有没有办法从另一个iframe重新加载一个iframe……我不介意接受我的任何一个答案~smile~。。。

countRefreshes = 0;
function refreshIframe(which) {
    var currHref = '' + parent.frames[which].location + '';
    parent.frames[which].location.href = currHref + '?c=' + countRefreshes + '';
    countRefreshes++;
}