inserting html content into iframe

inserting html content into iframe

hey!


my script looks like this:

var doc = frames[0].document;
  doc.open();
  doc.write(data);
  if($.browser.mozilla){
    setTimeout( function() {
      doc.close();
     }, 3000 );
  }
  else{ doc.close(); }








"data" is a string with html content. this works quite good in all browsers but I wonder if there is a better solution.

firefox doesn't load the content correctly if the content is too large and doc.close() is called too early.

ideas?