Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery / JavaScript - Loading iframe with Ajax slows down page
  2. $("#iframe_wrapper").each(function(){
  3.   $.ajax({
  4.     type: "post",
  5.     url: "http://site.com",
  6.     data: { action: 'get_the_iframe' },
  7.     context: this,
  8.     success: function(html){
  9.       $(this).html(html);
  10.       $(this).show();
  11.       $('#theiframe').load(function(){
  12.         // do stuff with the iframe...
  13.       });
  14.     }
  15.   });
  16. });
  17.        
  18. <iframe id="theiframe" name="theiframe" src="http://site.com/page/"></iframe>