SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XMLHttpRequest and Firefox 1.5

    Hello,

    I'm using Firefox 1.5 and FCKEditor in a CMS app. Everything works in older versions of Firefox but in 1.5 I get a javascript error saying that the XML file holding the styles can't be loaded.

    Here is the code where the xml request is made:
    Code:
    FCKXml.prototype.LoadUrl = function( urlToCall )
    	{
    		var oFCKXml = this ;
    
    		var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
    		oXmlHttp.open( "GET", urlToCall, false ) ;
    		oXmlHttp.send( null ) ;
    		
    		if ( oXmlHttp.status == 200 )
    			this.DOMDocument = oXmlHttp.responseXML ;
    		else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
    			this.DOMDocument = oXmlHttp.responseXML ;
    		else
    			alert( 'Error loading "' + urlToCall + '"' ) ;
    	}
    Everything works in IE but Firefox just gives the error that is set in the final else. Any ideas on how to debug further or fix (preferrably fix).

    Thanks in advance!

    Vernon
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  2. #2
    SitePoint Enthusiast PainBehindMyEye's Avatar
    Join Date
    Apr 2005
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a quick look here:
    shouldn't the line that reads
    oXmlHttp.open( "GET", urlToCall, false ) ;
    read a little differently? I.E. shouldn't it use 'true'?
    oXmlHttp.open( "GET", urlToCall, true ) ;

    I'd start there. If your testing for false (as it sort of looks to me), then it's always going to fall into your final 'else' condition. No?
    Last edited by PainBehindMyEye; Dec 13, 2006 at 09:35. Reason: I can't spell to save my life....apparently...


Bookmarks

Posting Permissions

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