View Single Post
  #3 (permalink)  
Old December 11th, 2007, 05:15 AM
celticbhoy celticbhoy is offline
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

quote:Originally posted by joefawcett
 Can you do a view-source of the page in IE and post the div xmlData and its contents?


Joe (Microsoft MVP - XML)
Thanks for the reply Joe
When I do a view-source of the page in IE I cant find the Div xmlData.
However I have used this code late last night and it prints all the values...

var objectPosition = document.getElementById('xmlData').getElementsByTagName("mappingDisplay");

alert("objectPosition - " + objectPosition.length);

    for(var i = 0; i < objectPosition.length ; i++)
    alert("innerText= " + document.getElementById("xmlData").innerText);
    alert("innerHTML= " + document.getElementById("xmlData").innerHTML);

And the alerts say this:

"innerText= vehicleName1 51.254663111111 -2.05014456321"


"innerHTML= <mappingDisplay><vehicleName>vehicleName1</vehicleName><latitude>51.254663111111</latitude>

So I take it that objectPosition is being read as a HTMLObject and not an Array.
Does anyone have the syntax to declare objectPosition as an Array and populate it so that I could iterate through it and print out the VehicleName, Longitude and Latitude separately?

Reply With Quote