views:

263

answers:

4

I have a webpage with an IFrame and a Button, once the button is pressed I need the IFrame to be refreshed. Is this possible, if so how? I searched and could not find any answers.

+2  A: 
var iframe = document.getElementById('youriframe');
iframe.src = iframe.src;
Balon
+1  A: 

This should help:

document.getElementById('FrameID').contentDocument.location.reload(true);
nfechner
+1  A: 

Got this from here

var f = document.getElementById('iframe1');
f.src = f.src;
Amarghosh
+1  A: 

provided the iframe is loaded from the same domain, you can do this, which makes a little more sense:

iframe.contentWindow.location.reload();

Horia Dragomir