What is the best method for creating an XMLHttpRequest object?
It should work in all capable browsers.
This is what I use, it works fine for me:
function request() { try { try { return new ActiveXObject("Microsoft.XMLHTTP") } catch( e ) { return new ActiveXObject("Msxml2.XMLHTTP") } } catch(e) { return new XMLHttpRequest() } }