Hello Friends,

Creating iframe using jQuery is not a difficult task. If you want to create iframe dynamically using jQuery, than look at below code.

Below is the code for generating dynamic iframe with jQuery.

$('<iframe />');  // Create an iframe element

$('<iframe />', {

    name: 'frame1',

    id: 'frame1',

src: 'http://www.programmingfacts.com'

}).appendTo('div#id');

// For older version of jQuery

$('<iframe />').attr('src', 'http://www.programmingfacts.com'); // Add iframe attributes

 

You can add iframe attribute as second parameter as per jQuery 1.4. For older version of jQuery, you can refer the syntax mention as above. If you find any problem in this than let me know by comment.

rax rss Create iframe dynamically using jQuery  rax twitter Create iframe dynamically using jQuery  rax facebook Create iframe dynamically using jQuery  rax myspace Create iframe dynamically using jQuery