Ver Mensaje Individual
  #15 (permalink)  
Antiguo 21/10/2005, 16:00
Avatar de Dorita
Dorita
 
Fecha de Ingreso: junio-2005
Ubicación: Entre la silla y el escritorio
Mensajes: 97
Antigüedad: 18 años, 11 meses
Puntos: 0
problemas con redireccion javascript y ajax

Hola Tunaits, bhonox, probe como me dijeron con el alert y esto es lo que me dice:
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Verficación usuario Tango</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
ingresado
</head>
<body>
</body>
</hmtl>

y este es el codigo completo:

controlUsuario.asp
Código HTML:
<script language="javascript" type="text/javascript">
	function handleHttpResponse(){
		if(http.readyState == 4){
			if(http.status == 200){
				if(http.responseText.indexOf('invalid') == -1){
					//Armamos un array, usando la coma para separar elementos
					results = http.responseText.split(",");
					alert(results[0])			
					
					if (results[0] == "no ingresado"){
						location.href = "repeticion.asp"
					}
					if (results[0] == "ingresado"){
						location.href = "requerimientoPendiente.asp"
					} 		
							
					document.getElementById("campoMensaje").innerHTML = results[0];
					enProceso = false;
				}
			}
		}
	}
	
	function verificaCliente(){
		if(!enProceso && http){
		var valor = escape(document.getElementById("txt_rutUsuario").value);
		var url = "verificaCliente.asp?txt_rutUsuario=" + valor;
		http.open("GET", url, true);
		http.onreadystatechange = handleHttpResponse;
		enProceso = true;
		http.send(null);
		}
	}
	
	function getHTTPObject(){
	var xmlhttp;
	/*@cc_on
	@if(@_jscript_version >=5)
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
					}catch(E) {xmlhttp = false;}	
				}
				@else
					xmlhttp = false;
					@end@*/				
					if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
						try{
							xmlhttp = new XMLHttpRequest();
						}catch(e) {xmlhtp = false;}
					}
					return xmlhttp;
	}
	
	var enProceso = false; //se utiliza para verificar si existen procesos activos
	var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest
</script>

</head>

<body>
<form action="post" name="controlUsuario">
<br><br><br><br>
<table width="40%" height="86%"  border="1" align="center">
  <tr>
    <td height="100%" valign="top">
	<br><br>
	<div align="center">Control de Requerimientos<br><br><br><br>
	<label>Ingrese Rut Cliente:</label>&nbsp;&nbsp;
	<input type="text" name="txt_rutUsuario" id="txt_rutUsuario" size="15">
	</div><br><br>
	<div align="center">
	<input type="button" value="Verificar" onClick="verificaCliente()">
	</div>
	<br><br>
	<div id="campoMensaje"></div>
	</td>
  </tr>
</table>
</form> 
verificaCliente.asp
Código HTML:
liente = Request.QueryString("txt_rutUsuario")	
	
	If (cliente = "") Then
		Response.Write("Ingrese rut del cliente")		
	ElseIf (Len(cliente) <8) Then
		Response.Write("Rut incompleto. Ingr&eacute;selo nuevamente")
	Else
		call ValidaRut		
	End If
%>
</head>

<body>
<%		
	Sub Requerimiento()
		If Request.QueryString("txt_rutUsuario") <> "" Then
			cliente = Request.QueryString("txt_rutUsuario")
			SQL = "SELECT id_requerimiento, servicio, id_ejecutivo, observacion, estado, fechaIngreso, insistencia FROM TB_Requerimiento WHERE	rutCliente = '"&cliente&"'; "
			Set RS = Conex.Execute(SQL)
		
			If Not(RS.EOF) Then
				Response.Write("ingresado")
			Else
				Response.Write("no ingresado")
			End If		
		End If		
	End Sub
el sub de verificarut no se los puse, por q no influye en nada el q lo saque o lo ponga...


de antemano muchisimas gracias chicos por toda vustra ayuda...
salu2.-
__________________

<nick>Dorita</nick>...si lo sé, soy una ñoña ;)