Home › Forums › JavaScript › Change the Iframe SRC Dynamically Without Triggering the Loading Spinner › Re: Change the Iframe SRC Dynamically Without Triggering the Loading Spinner
January 9, 2013 at 12:10 am
#120357
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);
}