• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 532
  • Last Modified:

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.
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.
  • 2
1 Solution
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.
JohnLourduAuthor Commented:
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/';

for (var i = 1; i<=count; i++) {
var curFrame = localStorage.getItem('curhtmlpath'+i);
var curCont = localStorage.getItem('curhtmlbody'+i);
var newid=curFrame+"?uid=12345";


Open in new window

Please advice.
The idea is to generate a new uid everytime you reload the page. After the URL with extension "?uid=12345" is loaded, its cached as well. You could add a timestamp or a random number instead. For example:

var newid=curFrame + "www.myurl.com?uid=" + Math.random();
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now