ProcessingInstruction.DOMCharacterDataModified.xml (997B)
1 <?xml version="1.0"?> 2 <root> 3 <head xmlns="http://www.w3.org/1999/xhtml"> 4 <title> ProcessingInstruction.data and DOMCharacterDataModified event </title> 5 </head> 6 <div id="log" xmlns="http://www.w3.org/1999/xhtml"></div> 7 8 <pi><?foo bar?></pi> 9 10 <script type="text/javascript" xmlns="http://www.w3.org/1999/xhtml"> 11 <![CDATA[ 12 var EVENT = "DOMCharacterDataModified"; 13 var TARGET = document.getElementsByTagName('pi')[0].firstChild; 14 var TestResult = false; 15 16 TARGET.addEventListener(EVENT, TestEvent, false); 17 TARGET.data = "new" + TARGET.data; 18 19 function TestEvent(evt) 20 { 21 if ((EVENT == evt.type) && (TARGET == evt.target) && ("newbar" == evt.newValue)) 22 { 23 TestResult = true; 24 } 25 else 26 { 27 TestResult = false; 28 } 29 } 30 ]]> 31 </script> 32 </root>