Hi Everyone!
I've been searching everywhere for a solution to my problem. It doesn't seem to be too complicated, but I just can't find it.
I have the following code:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script type="text/javascript">
var data=new XML()
data=
<food>
<fruit>
<apple>Yum!</apple>
<orange>Great</orange>
<beet>Yuk!</beet>
</fruit>
<veg>
<onion id="Tears">Layers</onion>
<cabbage>Round</cabbage>
</veg>
</food>
document.write(data.fruit.orange+' ');
document.write(data.veg.cabbage+' ');
document.write(data.veg.onion.@id+' ');
</script>
</head>
<body>
</body>
</html>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
It works fine, but I'd like to load the "xml" data from an external file and not have it on my html page.
Can someone please help me?
I've been searching everywhere for a solution to my problem. It doesn't seem to be too complicated, but I just can't find it.
I have the following code:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script type="text/javascript">
var data=new XML()
data=
<food>
<fruit>
<apple>Yum!</apple>
<orange>Great</orange>
<beet>Yuk!</beet>
</fruit>
<veg>
<onion id="Tears">Layers</onion>
<cabbage>Round</cabbage>
</veg>
</food>
document.write(data.fruit.orange+' ');
document.write(data.veg.cabbage+' ');
document.write(data.veg.onion.@id+' ');
</script>
</head>
<body>
</body>
</html>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
It works fine, but I'd like to load the "xml" data from an external file and not have it on my html page.
Can someone please help me?