home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 July & August
/
PCWorld_2003-07-08_cd.bin
/
Komunik
/
firebird
/
MozillaFirebird-0.6-win32.exe
/
MozillaFirebird
/
res
/
rdf
/
dom-test-5.xul
< prev
next >
Wrap
Extensible Markup Language
|
2000-06-15
|
1KB
|
44 lines
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil c-basic-offset: 2 -*- -->
<!--
This test exercises creation of DOM elements from the XUL document.
-->
<?xml-stylesheet type="text/css" href="dom-test-4.css"?>
<foo:foo xmlns:foo="http://foo.bar.com/xml#" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script>
var count = 0;
function newElement()
{
var elem = document.createElement('foo:bar');
var text = document.createTextNode('Node ' + ++count);
elem.appendChild(text);
document.lastChild.appendChild(elem);
}
function deleteElement()
{
if (document.lastChild.lastChild) {
document.lastChild.removeChild(document.lastChild.lastChild);
}
}
</html:script>
<html:input name="b1"
type="button"
value="New"
onclick="newElement();"/>
<html:input name="n2"
type="button"
value="Delete"
onclick="deleteElement();"/>
</foo:foo>