I use the following code to dynamically create an iframe.
var iframe_jquery = $(\"
I had this problem last week while playing with iFrames (building an rtf editor), and yeah it's not ready yet.
I thought if I put it in a .ready() it would work, but .ready() is when the DOM is ready, not when the iFrame has loaded its contents, so I ended up wrapping my code with jQuery .load().
So try this:
$(function () {
$("#myiframe").load(function () {
frames["myframe"].document.body.innerHTML = htmlValue;
});
});
Hope this helps