Link to home
Start Free TrialLog in
Avatar of JohnLourdu
JohnLourduFlag for Afghanistan

asked on

how to reload iframe content?

I have creating an inline html editor in the browser.
I have loading the html file using "iframe". Loaded iframe content is located in same domain.
Example:
http://172.26.6.28/epubapp/LoginSystem/page1.php
In the above page1.php I have dynamically loaded iframe content like this:
<iframe scrolling="no" frameborder="0" height="100%" class="readium-flowing-content" style="position: relative; z-index: 0; top: 0px; left: 0px; width: 956px; height: 436px; padding-left: 53px; padding-right: 53px; margin-left: 0px;" src="epub_content/siddhartha3/OPS/s007-Part-001.xhtml" title="Siddhartha - EPUB3"></iframe>
Using HTML5 contenteditable I have edited iframe content and save using ajax and php.
All the above functions are fine. But I refresh the page1.php, iframe content not reloaded. Please advice how to solve this issue.
Avatar of Ironhoofs
Ironhoofs
Flag of Netherlands image

Maybe its allready working, but your browser / webserver reloads the iframe content from cache. You could check this by adding some unique data to your request (i.e. src="epub_content/siddhartha3/OPS/s007-Part-001.xhtml?uid=12345) and disabling the webbrowser cache.
Avatar of JohnLourdu

ASKER

Manually i have to change uid iframe content reloaded. But I have using below code in onload not working:
if (localStorage.getItem('flag')) {
var count = localStorage.getItem('wrapcount');

//document.domain = document.domain + '/epubapp/LoginSystem/';
//alert(document.domain);

for (var i = 1; i<=count; i++) {
var curFrame = localStorage.getItem('curhtmlpath'+i);
var curCont = localStorage.getItem('curhtmlbody'+i);
//alert(curCont);
//$("iframe[src='"+curFrame+"']").contents().find("body").html(curCont);
var newid=curFrame+"?uid=12345";
alert(newid);
$(".readium-flowing-content").attr("src",newid);
}

}

Open in new window

Please advice.
ASKER CERTIFIED SOLUTION
Avatar of Ironhoofs
Ironhoofs
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial