JavaScript
Article

jQuery Reload an iFrame

By Sam Deering

Simple jQuery code snippet to reload an iFrame by accessing the contentWindow property to obtain the location object. The jQuery snippet code actually loops through and refreshes all the iFrames on the page.

Also see:

//reload 1 iframe
$('#iframe').contentWindow.location.reload(true);

//reload all iFrames
$('iframe').each(function() {
  this.contentWindow.location.reload(true);
});

No Reader comments

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.