我正在尝试将元素从一个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()")
}
答案 0 :(得分:1)
parent.frames( “测试”)yourIframeFunction();
OR
parent.frames [0] .yourIframeFunction();
parent.yourMainDocumentFunction();
答案 1 :(得分:1)
countRefreshes = 0;
function refreshIframe(which) {
var currHref = '' + parent.frames[which].location + '';
parent.frames[which].location.href = currHref + '?c=' + countRefreshes + '';
countRefreshes++;
}