[jQuery] iframe and designmode
Hi all,
I need to use the following command to activate designmode in an iFrame (designmode is when you can use an iFrame like it was a text editor, think Word or when you compose an email in Gmail):
<span style="font-family: courier new,monospace;">
document.getElementById("<span style="font-weight: bold;">iframe_name</span>").contentWindow.document.<span style="font-weight: bold;">designMode</span> = "<span style="font-weight: bold;">on</span>"</span>
I've tried to jQuerify the sentence in a variety of manners but it never works. Sometime the command wont work and other times they trigger an error. So far I've tried with (I use the reserved word "each" cause I'm working inside a plugin):
<span style="font-family: courier new,monospace;">$(this).<span style="font-weight: bold;">contentWindow.document.designMode</span> = "on";</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
$(this).<span style="font-weight: bold;">document.designMode</span> = "on";</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">$(this).<span style="font-weight: bold;">
designMode</span> = "on";</span>
and
<span style="font-family: courier new,monospace;">$(this).attr("<span style="font-weight: bold;">contentWindow.document.designMode</span>", "on")
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">$(this).attr("<span style="font-weight: bold;">document.designMode</span>", "on")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">$(this).attr("<span style="font-weight: bold;">designMode</span>", "on")</span>
nothing worked.
I wouldn't mind sticking to pure javascript for once, but the thing is that this doesn't work either, wich is driving me crazy:
<span style="font-family: courier new,monospace;">document.getElementById(<span style="font-weight: bold;">$(this).attr("id")</span>).contentWindow.document.designMode = "on"</span>
Has anyone here used designMode for an iFrame with good results? Why doesn't jQuery support it?
Thanks.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/