views:

15

answers:

0

I am trying to insert HTML into the YUI rich text editor. The code works if I use simple HTML snippets, but if I use something more complicated (e.g. try to embed an object), then it fails.

Edit

Fails - only for FF browser

For example - this works:

var html = '<div><b><u>Hello world!</u></b></div>';
myEditor.execCommand('inserthtml', html);

But this dosen't work:

var html = '<div><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/OVXIh4q-OmM?fs=1&amp;amp;hl=en_GB&amp;amp;rel=0"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OVXIh4q-OmM?fs=1&amp;amp;hl=en_GB&amp;amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></div>';

myEditor.execCommand('inserthtml', html);

Does anyone know why?