What’s the best way to reload / refresh an iframe?
document.getElementById('some_frame_id').contentWindow.location.reload();
be careful, in Firefox, window.frames[]
cannot be indexed by id, but by name or index
document.getElementById('iframeid').src = document.getElementById('iframeid').src
It will reload the iframe
, even across domains!
Tested with IE7/8, Firefox and Chrome.
If using jQuery, this seems to work:
$('#your_iframe').attr('src', $('#your_iframe').attr('src'));
I hope it's not too ugly for stackoverflow.