SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firefox (mac only) not liking my xmlObject. Trying to ajax to a servlet

    this code works fine on every other browser that i have (and i test across alot of them) except for the mac version of firefox.

    Code:
    	function getXMLObject(){
    		var xmlHttp = false;
    		try {
    			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP")  // For Old Microsoft Browsers
    		} 
    		catch (e) {
    			try {
    				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")  // For Microsoft IE 6.0+
    			}
    			catch (e2) {
    				xmlHttp = false   // No Browser accepts the XMLHTTP Object then false
    			}
    		}		
    		if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
    			xmlHttp = new XMLHttpRequest();        //For Mozilla, Opera Browsers
    		}
    		return xmlHttp;  // Mandatory Statement returning the ajax object created
    	}
    I think the offending code is:
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP")

    its odd that it this works on safari (mac) chrome(mac) but not firefox... I am used to firefox being worry free...

  2. #2
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any errors in the Error Console?

    Jeff
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


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
  •