thanks for prototype.jsを使おう:Try.these()の使い方
if(window.XMLHttpRequest) {
ajax = new XMLHttpRequest(); //一般的なブラウザ
} else {
ajax = new ActiveXObject("Microsoft.XMLHTTP"); // IE
} else {
ajax = false; // Ajax 非対応ブラウザ
}
return Try.these(
function() { return new ActiveXObject('Msxml2.XMLHTTP') },
function() { return new ActiveXObject('Microsoft.XMLHTTP') },
function() { return new XMLHttpRequest() }
) || false;