這是我在stackoverflow上的第一個問題,但我已經在這裏做了很多次旅行來解決其他問題,但是我找不到這個問題的答案:如何在xul文件中創建div contentEditable Firefox擴展?如何在xul文件(Firefox擴展)中創建div contentEditable?
-The以下是我希望我的.xul文件的一部分包含在div CONTENTEDITABLE:
<page id="sbEmptySidebar" title="&emptysidebar.title;"
xmlns:html="http://www.w3.org/1999/xhtml">
<vbox flex="1">
<label id="atest" value="&emptysidebar.title;" />
</vbox>
<html:div contentEditable value="Tryitout" style="width:150px;height:200px"/>
<html:input type="button" value="Bold" onclick="document.execCommand('bold',false,null);"/>
</page>
當我這樣做,我收到以下錯誤在我的分機的側邊欄:
XML Parsing Error: not well-formed<br/>
Location: chrome://emptysidebar/content/emptysidebar.xul<br/>
Line Number 41, Column 29:<br/>
`<html:div contentEditable value="Tryitout"style="width:150px;height:200px"/>
-------------------------------^`
我已經發現了一些例子,其中DIV做這樣一來,在哪裏,而不是隻是說CONTENTEDITABLE你說CONTENTEDITABLE =「真」:
<page id="sbEmptySidebar" title="&emptysidebar.title;"
xmlns:html="http://www.w3.org/1999/xhtml">
<vbox flex="1">
<label id="atest" value="&emptysidebar.title;" />
</vbox>
<html:div contentEditable="true" value="Tryitout" style="width:150px;height:200px"/>
<html:input type="button" value="Bold" onclick="document.execCommand('bold',false,null);"/>
</page>
當我這樣做時,我沒有收到任何錯誤,但沒有顯示,而是一個空白的150x200像素框。有什麼我失蹤,使一個Firefox擴展xul文件中的contentEditable div可能嗎?
好的,非常感謝。我只使用了一個iframe,它效果很好! –
對不起,我忘了。 –