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.
JavaScriptAJAXPHP

Avatar of undefined
Last Comment
Ironhoofs

8/22/2022 - Mon
Ironhoofs

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.
ASKER
JohnLourdu

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
Ironhoofs

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck