Titulo
var READY_STATE_UNINITIALIZED=0;
var READY_STATE_LOADING=1;
var READY_STATE_LOADED=2;
var READY_STATE_INTERACTIVE=3;
varREADY_STATE_COMPLETE=4;
var peticion_http;
var arr_peticiones=new Array();
function cargaContenidoDirecto(url, metodo) {
peticion_http = inicializa_xhr();
if(peticion_http) {peticion_http.open(metodo, url, false);
peticion_http.send(null);
return peticion_http.responseText;
}
}
function cargaContenidoMulti(url, metodo,funcion,params,valorpost,repetir) {
repetir = (typeof repetir == 'undefined') ? 1: repetir ;
var aleatorio=new Date().getTime();
peticion_http = inicializa_xhr();
if (repetir==1){arr_peticiones.push(new Array(url,metodo,funcion,params,valorpost,0));
}
if(peticion_http) {
arr_peticiones[0][3] = (typeof arr_peticiones[0][3] == 'undefined') ? "":arr_peticiones[0][3] ;
arr_peticiones[0][4] = (typeof arr_peticiones[0][4] == 'undefined') ? "": arr_peticiones[0][4] ;
peticion_http.onreadystatechange = function(){
if(arr_peticiones[0][3]!='undefined'){
arr_peticiones[0][2](arr_peticiones[0][3]);
}else{
arr_peticiones[0][2]();
}if(peticion_http.readyState == READY_STATE_COMPLETE && peticion_http.status == 200) {
arr_peticiones.shift();
if (arr_peticiones.length>0){cargaContenidoMulti(arr_peticiones[0][0],arr_peticiones[0][1],arr_peticiones[0][2],arr_peticiones[0][3],arr_peticiones[0][4],arr_peticiones[0][5]);
}
}
}if(arr_peticiones[0][1]=="POST"){
peticion_http.open(arr_peticiones[0][1], arr_peticiones[0][0],true);
peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");...
Regístrate para leer el documento completo.