Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Change the Iframe SRC Dynamically Without Triggering the Loading Spinner Re: Change the Iframe SRC Dynamically Without Triggering the Loading Spinner

#120357
Taufik Nurrohman
Participant

Works except in Google Chrome :D

<div id="container"></div>
<div id="iframe-holder">
<iframe src="" id="frame"></iframe>
</div>
function insert() {
var url = 'iframe-page.html',
holder = document.getElementById('iframe-holder'),
frame = holder.getElementsByTagName('iframe')[0];
frame.style.display = "block";
frame.src = url;
document.getElementById('container').insertBefore(holder, null);
}

http://jsfiddle.net/kw7LD/88/