2010-09-29 68 views
1

我想插入HTML到YUI富文本編輯器。如果我使用簡單的HTML代碼片段,代碼就可以工作,但如果我使用更復雜的東西(例如嘗試嵌入對象),那麼它會失敗。插入html到雅虎的YUI富文本編輯器

編輯

失敗 - 僅適用於FF瀏覽器

例如 - 這工作:

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

但這這麼想的工作:

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

myEditor.execCommand('inserthtml', html); 

母鹿有誰知道爲什麼?

回答

相關問題