You can do something like this:
if (!window.XMLHttpRequest) {
window.XMLHttpRequest = function() {
return new ActiveXObject('Microsoft.XMLHTTP');
};
}
I recommend looking at an AJAX library though, life is much easier in jQuery, ExtJS, MooTools, whatever you prefer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…