CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Posts
    8

    Post Loading XML file with FireFox

    Hi there,

    I need to load an XML document in order to fill a selectbox with several options. I have created (ok... i pulled it from the net) a piece of code that loads the XML file and then fills the selectbox quite nice. Only problem here is that the script works fine in IE but not in Firefox or any other NON IE browser.

    my script:

    Code:
    function importXML(filename, elm_id)
    {
    	if (document.implementation && document.implementation.createDocument)
    {
            //NON IE Code
    	xmlDoc = document.implementation.createDocument("", "", null);
    	var isLoaded = xmlDoc.load("http://" + document.domain + "/xml/pagelist.xml");
            
            if (isLoaded == true) 
            {
             createTable(elm_id);
            }  
    	
    }
    	else if (window.ActiveXObject)
    	{
            //IE Code
    		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    		xmlDoc.onreadystatechange = function () {
    			if (xmlDoc.readyState == 4) createTable(elm_id)
    		};
    		xmlDoc.load("http://" + document.domain + "/xml/pagelist.xml");
     	}
    	else
    	{
    		alert('Your browser can\'t handle this script');
    		return;
    	}
    }
    Then i try to load the XML it seems it just can't find the corect file because it does not contain any data. Is this a path issue or something with rights? It doesn't work either on localhost or on the internet.

    Anyone here that can tackle this problem? Your help is kindly appreciated.

    Kind regards,

    Eric Mulder

  2. #2
    Join Date
    Feb 2003
    Location
    AR
    Posts
    228

    Re: Loading XML file with FireFox

    I don't think FireFox is aware of the MSXML library... and if it is, surely it won't use it anyway.

    Even the most basic XSL pattern will fail in FireFox, so just keep the error message and provide a link to download IE6.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured