Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referring to an XML Data Island in Javascript
Message
General information
Forum:
Internet
Category:
Javascript
Title:
Referring to an XML Data Island in Javascript
Miscellaneous
Thread ID:
00669196
Message ID:
00669196
Views:
35
I am trying to attach an event listener to an XML Data Island, and i just cannot figure out how to reference the data island. Can anyone see the problem or point me in another direction? This example seems, to me, to be right in line with various ms examples of manipulating data sources in javascript, but I just can't get it working.

This is the complete code, so if you want to cut and paste and try...
<html>

<body onload = "fnLoadAction">
<xml id = "XMLData">
	<records>
		<record>
			<Age>123456.7</Age>
			<Score>23232.7</Score>
		</record>
	</records>
</xml>
<input name="input1" id="input1" datasrc="#XMLData" datafld="Age"><p></P>
<input name="input2" id="input2" datasrc="#XMLData" datafld="Score"><p></P>
</body>
</html>

<script LANGUAGE = Javascript>

function fnLoadAction(){

xmlData.addEventListener('ondatasetchanged', fnChangeOccured, false);  //ERROR//

// and even something as basic as this doesn't work!
alert (xmlData.documentElement.xml);	//ERROR//


}


function fnChangeOccured(){
alert ("The dataset has changed!");
}


</script>
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Reply
Map
View

Click here to load this message in the networking platform