XUL内容如下
<?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"
我想要在<hbox id="aContainer"></hbox>内插入一段HTML的代码,代码如下:
<html:a href="http://mozilla.org">Mozilla.org</html:a>
<html:table>
<html:tr><html:td></html:td></html:tr>
......
......
more content
......
</html:table>
我怎么把这段代码插入到上面那个hbox里面?
我用 DOMParser 处理的时候,界面上提示解析错误
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);
高手们,请帮帮忙,谢谢了
我按照你的方法写了一个文件:test.xul
代码如下:
<?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">
<hbox id="aContainer">
<html:a href="http://mozilla.org">Mozilla.org</html:a>
<html:table>
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。
新闻热点
疑难解答