Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referring to an XML Data Island in Javascript
Message
Information générale
Forum:
Internet
Catégorie:
Javascript
Titre:
Referring to an XML Data Island in Javascript
Divers
Thread ID:
00669196
Message ID:
00669196
Vues:
34
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
Répondre
Fil
Voir

Click here to load this message in the networking platform