views:

52

answers:

2

hi all,

I am trying to set element from one iframe to another.

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()")                
        }

thanks Hemant

+1  A: 

-- To reference iframe javascript/document

parent.frames("test").yourIframeFunction();

OR

parent.frames[0].yourIframeFunction();

-- To reference parent/top document's javascript/document

parent.yourMainDocumentFunction();

drlouie - louierd
+1  A: 

-- To reload iframe content


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