Javascript 如何设置另一个iframe的元素?
我试图将元素从一个iframe设置到另一个iframeJavascript 如何设置另一个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
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++;
}