20 lines
621 B
JavaScript
20 lines
621 B
JavaScript
|
|
function creaAjax(){
|
||
|
|
var objetoAjax=false;
|
||
|
|
try {
|
||
|
|
/*Para navegadores distintos a internet explorer*/
|
||
|
|
objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
|
||
|
|
} catch (e) {
|
||
|
|
try {
|
||
|
|
/*Para explorer*/
|
||
|
|
objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
|
||
|
|
}
|
||
|
|
catch (E) {
|
||
|
|
objetoAjax = false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!objetoAjax && typeof XMLHttpRequest!='undefined') {
|
||
|
|
objetoAjax = new XMLHttpRequest();
|
||
|
|
}
|
||
|
|
return objetoAjax;
|
||
|
|
}
|