Reputation: 11
I'm using Adobe Edge to build a website and I have a few iframes that load other html pages on my index.html page. All the files are on the same domain.
No idea why, but some of the iframes content doesn't load correctly in firefox. But when I refresh the iframe it loads perfect, so i need the iframes to automatically reload (only once) when loaded.
Iv'e seen a possible solution on this page: How to force an iFrame to reload once it loads
I'm just not sure where in adobe edge to put the solution script.
This is how each iframe in "creationComplete" looks for now:
sym.$("AboutPage").append('<iframe width="100%" height="100%" src="About.html" frameborder="0" scrolling="no"></iframe>');
Upvotes: 1
Views: 1522
Reputation: 524
sym.$("AboutPage").append('<iframe onload="reloadOnce(this)" width="100%" height="100%" src="About.html" frameborder="0" scrolling="no"></iframe>');
sym.$("otherPage").append('<iframe onload="reloadOnce(this)" width="100%" height="100%" frameborder="0" scrolling="no" src="otherPage.html"></iframe>');
var iframeLoadCount = 0;
function reloadOnce(iframe) {
iframeLoadCount ++;
if (iframeLoadCount <= 1) {
iframe.contentWindow.location.reload();
console.log("reload()");
}
}
I think this is how the code is suppose to be written in "creationComplete" I am not 100% sure because I do not have a problem loading the iFrames in FireFox on my computer. Let me know if this doesn't work for you.
Upvotes: 0