JohnLourdu
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-con tent" 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/siddhart ha3/OPS/s0 07-Part-00 1.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.
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-con
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.
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/siddhart ha3/OPS/s0 07-Part-00 1.xhtml?ui d=12345) and disabling the webbrowser cache.
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);
}
}
Please advice.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.