iframe textarea vanishes after load

May 27, 2012 at 1:55 PM

I have created a simple textarea and then invoked the htmlarea() method to instantiate the jHtmlArea element. The editor is created as expected but at the end, the textarea inside the iframe gets deleted.

This is the rendered HTML.

<div class="jHtmlArea" style="width: 579px;">

<div class="ToolBar" style="width: 577px;">...</div>


<iframe style="height: 417px; width: 575px;"></iframe>


<textarea cols="70" rows="25" name="answerText" id="answerText" style="display: none;">&lt;p&gt;&lt;h3&gt;Another TextArea&lt;/h3&gt;This is some sample text to test out the &lt;b&gt;WYSIWYG Control&lt;/b&gt;.&lt;/p&gt;</textarea>


As you can see, the <iframe> is empty!

I am using jquery 1.5.2 & jquery UI 1.8.13

Is there any way iframe contents can get deleted in this manner?

May 27, 2012 at 3:32 PM

Found how to fix this but did not understand the cause yet.

When I add jquery.min.js to my page, the problem is resolved.

But my page is dynamically generated via AJAX and I have already included jquery.min.js in my container page so I should not have to include it again. But if I don't, then the <iframe> contents disappear!

Also, this is a problem with Firefox 12. Chrome seems to be working fine without inclusion of the jquery main js.

Strange issues! If anyone understands the cause, please share your knowledge.