thanks for prototype.jsを使おう:Try.these()の使い方

ブラウザによって処理を変える

if(window.XMLHttpRequest) {
	ajax = new XMLHttpRequest();	//一般的なブラウザ
} else {
	ajax = new ActiveXObject("Microsoft.XMLHTTP");	// IE
} else {
	ajax = false;	// Ajax 非対応ブラウザ
}

prototype.jsを使ってxxxというIDを見つける

return Try.these(
	function() { return new ActiveXObject('Msxml2.XMLHTTP') },
	function() { return new ActiveXObject('Microsoft.XMLHTTP') },
	function() { return new XMLHttpRequest() }
	) || false;