jQuery iFrame - A JQuery Plugin

This is jQuery iFrame, a plugin to help you set iframe source and squirt content into iframes, by Michael Mahemoff, under MIT License. It gives you a callback so you know when the frame has been loaded, tells you how long it took to load, and provides timeout support.

Download
jquery.iframe.js

Demo

Load http:// 
with timeout ms
 

API

$("iframe").src(url, optionalCallback, options); $("iframe").squirt(html, optionalCallback, options);

Options are:

Caveats

Usage


$("<iframe/>").src("http://google.com").appendTo("body");

$("iframe").squirt("a <em>little</em> content");

$("iframe").src("http://google.com", function(iframe, duration) { 
  alert("That took " + duration + " millis.");
}, {
  timeout: function() { alert("oops! timed out."); },
  timeoutDuration: 10000
});