Can't solve error with my html file when reading xml file(API) plz help

Discussion in 'Google API' started by nourelmasry, Sep 23, 2007.

  1. #1
    In my html file i'm trying to read from an xml file which has the lat and lng of markers to display on google map. i do the following steps:

    var request = GXmlHttp.create();
    request.open("GET", "example.xml", true);
    request.onreadystatechange = function() {
    if (request.readyState == 4) {
    var xmlDoc = GXml.parse(request.responseText);
    // obtain the array of markers and loop through it

    var markers = xmlDoc.documentElement.getElementsByTagName("marker");

    and here in this step it appears the error and says:

    Error:'documentElement' is null or not an object....


    and i'm sure from the tag name and the file name.

    so is there any body has an answer for this error???

    plz help

    thanks
     
    nourelmasry, Sep 23, 2007 IP
  2. nourelmasry

    nourelmasry Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    now i knew what's the problem but i can't solve too.

    the problem is that the html file can't find the xml file and it doesn't open it while it is in the same directory and even if iu put the whole path.

    is there any suggestions how can i solve this problem????
     
    nourelmasry, Sep 25, 2007 IP