Código PHP:
var Try = { these:function(funclist)
{ for(var a=0,b=arguments.length;a<b;++a)
{ try { return (arguments[a])() } catch(e) {} }
} }
function create_xmlhttp()
{
var xmlhttp = Try.these(
function() {return new ActiveXObject('Microsoft.XMLHTTP')},
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
function() {return new XMLHttpRequest()},
function() {return window.createRequest()}
) || false;
Try.these(xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'));
return xmlhttp;
}
Gracias