Wednesday, March 27, 2013

Using jQuery to insert IFrame dynamically after page loads.

Using jQuery to insert IFrame dynamically after page loads. This can be used to insert Iframe from ajax response as well.
$(function() {
// wait for DOM to fully load

$("#target").html('<iframe id="imageUpload" src="imgupload.php"><\/iframe>'');
$("#imageUpload").live("load", function() {
alert("iframe loaded");
});

});

No comments: