Joho the Blog » Refresh an iframe in IE? Anyone?
EverydayChaos
Everyday Chaos
Too Big to Know
Too Big to Know
Cluetrain 10th Anniversary edition
Cluetrain 10th Anniversary
Everything Is Miscellaneous
Everything Is Miscellaneous
Small Pieces cover
Small Pieces Loosely Joined
Cluetrain cover
Cluetrain Manifesto
My face
Speaker info
Who am I? (Blog Disclosure Form) Copy this link as RSS address Atom Feed

Refresh an iframe in IE? Anyone?

I’ve googled until I’m gaga, but I can’t find the javascript code that will refresh an iframe from the server without refreshing the rest of the page. For this app I am using — forgive me — IE 7.0. Yes, I know iframes are not In, but I don’t know of another way to do picture-in-picture, so to speak, where the page being displayed is scrollable.

The iframe itself looks like this:

<iframe id=”browse” src=”http://www.JohoTheBlog.com” width=’100%’ height=’600px’ style=”display:block;”></iframe>

To refresh it, I’ve tried the following (and many variations of each):

var fr=document.getElementById(‘browse’);

fr.src=fr.src;

document.frames[“browse”].location.href=fr.src;
window.frames[‘browse’].reload(true);
window.fr.location.reload(true);

top.frames[‘browse’].location.reload(true);

top.frames[‘browse’].location.href=fr.src;
window.location.reload(true);
fr.reload(true);
fr.refresh.dammit.you.bastard(true);
fr.i.will.hurt.you.i.mean.it(true);

Some of these do nothing. Some refresh the entire page, including the iframe. None refreshes only the iframe, forcing a reload from the server. Although nothing hangs on the project, I’ve now spent several hours trying to solve this little problem. Ack.

What is the vector of my particular dumbness this time? I’m sure it’s something embarrassing. But it’ll be worth displaying my ignorance yet again if someone knows the magic incantation that will end my misery… [Tags: ]

Previous: « || Next: »

Leave a Reply

Comments (RSS).  RSS icon