Source code
Revision control
Copy as Markdown
Other Tools
<?xml version="1.0"?>
<root>
<title> ProcessingInstruction.data and DOMCharacterDataModified event </title>
</head>
<pi><?foo bar?></pi>
<![CDATA[
var EVENT = "DOMCharacterDataModified";
var TARGET = document.getElementsByTagName('pi')[0].firstChild;
var TestResult = false;
TARGET.addEventListener(EVENT, TestEvent, false);
TARGET.data = "new" + TARGET.data;
function TestEvent(evt)
{
if ((EVENT == evt.type) && (TARGET == evt.target) && ("newbar" == evt.newValue))
{
TestResult = true;
}
else
{
TestResult = false;
}
}
]]>
</script>
</root>