XUL content is as follows
<?xml version= "1.0"?>
<?xml-stylesheet href= "chrome://global/skin/" type= "Text/css"?>
<?xml-stylesheet href= "Chrome://easyeffective/content/styles/global.css" type= "Text/css"?>
<window
Id= "Test"
Title= "Test"
Xmlns= "Http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
Xmlns:html= "Http://www.w3.org/1999/xhtml"
Onload= "Onload ()"
Persist= "ScreenX screenY width height SizeMode" >
<script src= "Chrome://test/content/scripts/test.js" type= "Application/x-javascript"/>
<vbox flex= "1" >
</vbox>
<statusbar pack= "Left" >
<statusbarpanel flex= "1" pack= "left" ><description>label;</description></statusbarpanel>
<statusbarpanel id= "Page-report-button" blocked= "true"/>
</statusbar>
</window>
I want to insert a section of HTML code in the
......
......
More content
......
How do I get this piece of code into the Hbox?
When I use Domparser processing, the interface prompts parse error
var dp = new Domparser ();
var newdom = dp.parsefromstring (htmlcontent, "text/xml");
This step has Errors
The Error like this ' XML parsing error:prefix not bound to namespace ... '
document.getElementById (' Acontainer '). appendchild (newdom.documentelement);
Experts, please help, thank you
I wrote a file according to your method: Test.xul
The code is as follows:
<?xml version= "1.0"
<?xml-stylesheet href= "chrome://global/skin/" type= "Text/css"
.? Xml-stylesheet href= "Chrome://easyeffective/content/styles/global.css" type= "Text/css"
<window
Id= "Test"
title= "test"
xmlns= "Http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html= "Http://www.w3.org/1999/xhtml"
onload= "onload ()"
persist= "ScreenX screenY width height sizemode"
< Script src= "Chrome://test/content/scripts/test.js" type= "Application/x-javascript"/>
<vbox flex= "1" >
< Html:table>
</vbox>
<statusbar pack= "left"
< StatusBarPanel flex= "1" pack= "left" ><description>label;</description></statusbaRpanel>
<statusbarpanel id= "Page-report-button" blocked= "true"/>
</statusbar>
</ Window>
then displays with Ff3.5beta, displays correctly, and opens the error console with 3 error 1 warnings
1 No Chrome package registered for CHROME://EASYEFFECTIVE/CONTENT/STYLES/GLOBAL.CSS
2 No Chrome package registered for Chrome://test/content/scripts/test.js
3 Warning: The Hbox element's XUL block contains an inline a child node that causes all of its child nodes to be contained in a block.
Source file: File:///C:/Documents%20and%20Settings/gh/%E6%A1%8C%E9%9D%A2/test.xul
Line: 0
4 Error: Onload is not defined
Source file: File:///C:/Documents%20and%20Settings/gh/%E6%A1%8C%E9%9D%A2/test.xul
Line: 1
3 errors are expected, as far as warning I do not know why, but do not affect the display.
Your grammar is correct, it may be a problem elsewhere.
Besides, you are not clear about your problem, what exactly do you want to do? How do I insert HTML code or Domparser Why do I have an error? If you do not affect the use of too much attention to parsing errors, the mixed use of HTML and XUL is an irregular method, causing errors, especially parsing errors are inevitable