Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
152
rated 0 times [  155] [ 3]  / answers: 1 / hits: 23144  / 12 Years ago, fri, june 15, 2012, 12:00:00

I have an app (facebook canvas app, facebook displays the app in an iframe)



When the user clicks on a link I want to be able to refresh the page.



the code i m using to refresh the page is as follows:



window.location.reload(true);


With firefox this works fine, it only refreshes the current page within the iframe. So i m happy.



With IE, the whole page is being refreshed which causes the user to go the beginning of the app.



How can i avoid that?



I just want refresh the current page not the current url.



apps.facebook.com/foo/


is the app URL and within URL user clicks on a link go to a page, then within that Page i need to refresh that page to update some counters. but when i refresh the whole request goes to apps.facebook.com/foo/



any ideas?


More From » html

 Answers
4

As stated in http://www.hyperorg.com/blogger/2007/03/24/refresh-an-iframe-in-ie-anyone/



HTML



<div id=wrapper></div>


Javascript



function reload () {
var fr=document.getElementById('tehframe');
if(fr!=null) document.getElementById(wrapper).removeChild(fr);
var iframehtml=<iframe id='tehframe' src=…></iframe>;
document.getElementById(wrapper).innerHTML=iframehtml;
}


Then just call reload() at the beginning and whenever you want to load it.


[#84888] Thursday, June 14, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tobyl

Total Points: 598
Total Questions: 110
Total Answers: 114

Location: Vietnam
Member since Sat, Feb 12, 2022
2 Years ago
tobyl questions
Tue, Aug 10, 21, 00:00, 3 Years ago
Wed, Jan 13, 21, 00:00, 3 Years ago
Tue, Dec 1, 20, 00:00, 4 Years ago
;