AJAX and Cross-Browser Compatability

I’m looking to upgrade some of my scripts to AJAX (right now I’m sending info back and forth between an iframe), but wanted to make sure I wasn’t losing some cross-browser compatibility by doing so. I saw this double checker on one of the tutorials and liked it, but I want to make sure it isn’t limiting any other common (maybe even slightly older) browsers:


//Browser Support Code
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser Doesn't Support this Feature");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			//dosomething
		}
	}
	ajaxRequest.open("GET", "file.php", true);
	ajaxRequest.send(null); 
}

Look good? Or will I be leaving a proportion of visitors out with incompatible browsers?

Thanks
Ryan

until ie8, ajax required activex. That’s not always enabled. really old browsers just don’t support it at all.

I don’t know if certain browser security setting levels commonly prevent ajax where an iframe would still work, but it wouldn’t suprise me.

Alright,

So i guess I can have the if statement use the iframe function I am currently using if the option to use AJAX is unavailable.

Cheers
Ryan