It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

DOM for xml in Firefox doesn't work but works in IE?

DOM for xml in Firefox doesn't work but works in IE?

Postby WingYn on Tue Nov 10, 2009 10:01 am

I want to put the postalcodes in an array from an xml file but it doesn't work in Firefox o.O Anyone can help with this?

Code: Select all
if(document.implementation && document.implementation.createDocument)
   {
      xmlDoc = document.implementation.createDocument("", "", null);
      xmlDoc.async = false;
      xmlDoc.load("cities.xml");
      /*xmlDoc = document.implementation.createDocument("","",null);*/
      xmlObj = xmlDoc.documentElement;
      /*this.states = [];
      xmlDoc.load('cities.xml');*/
         for (i=0;i<1200;i++)
         {
            this.states[i] = xmlObj.childNodes[i].firstChild.text;
         }
   }
WingYn
 
Posts: 2
Joined: Tue Nov 10, 2009 9:57 am

Re: DOM for xml in Firefox doesn't work but works in IE?

Postby WingYn on Tue Nov 10, 2009 10:41 am

I got it working :)
WingYn
 
Posts: 2
Joined: Tue Nov 10, 2009 9:57 am


Who is online

Users browsing this forum: No registered users and 3 guests