File "buscadorUsuarios.js"

Full path: /home/dsvchile/public_html/equote/buscadorUsuarios.js
File size: 1.29 B
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

function xmlhttp(){
	var xmlhttp;
	try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){
		try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
		catch(e){
			try{xmlhttp = new XMLHttpRequest();}
			catch(e){
				xmlhttp = false;
			}
		}
	}
	if (!xmlhttp) 
		return null;
	else
		return xmlhttp;
}

function buscar(){

	var A = document.getElementById('tblBody');
	var B = document.getElementById('loading');
	
	var IdMenuIni = document.getElementById('IdMenuIni').value;
	
	var Nombre = document.getElementById('Nombre').value;
	var ApellidoPaterno = document.getElementById('ApellidoPaterno').value;
	var ApellidoMaterno = document.getElementById('ApellidoMaterno').value;
	var Username = document.getElementById('Username').value;

	var ajax = xmlhttp();
	
	ajax.onreadystatechange=function(){
		if(ajax.readyState==1){
			B.innerHTML = "<img src='../images/loading.gif' alg='Loading...'>";
		}
		if(ajax.readyState==4){
			A.innerHTML = ajax.responseText;
			B.innerHTML = "";
		}
	}
			
	ajax.open("GET","busquedaUsuarios.php?IdMenuIni="+encodeURIComponent(IdMenuIni)+"&Nombre="+encodeURIComponent(Nombre)+"&ApellidoPaterno="+encodeURIComponent(ApellidoPaterno)+"&ApellidoMaterno="+encodeURIComponent(ApellidoMaterno)+"&Username="+encodeURIComponent(Username),true);
	ajax.send(null);

	return false;
}