Retroceder   Foros del Web > Programación para sitios web > AJAX

Respuesta
 
Herramientas Desplegado
Antiguo 10-sep-2007, 09:56   #1 (permalink)
jahman está en el buen camino
 
Avatar de jahman
 
Fecha de Ingreso: noviembre-2003
Ubicación: Santiago
Mensajes: 141
Buscador con Ajax

Sres un saludo...
logre hacer un buscador con ajax onda que minestras escribes la palabras en el textfields se va generando la buscando visualizandose abajo el problema es que si hago click afuera del cajon pierdo el evento y cuando quiero ingresar otra busqueda el cajon se encuentra bloqueado no se xq podria alguien decirme xq pasa esto....espero que me puedan ayudar. Gracias.

Código HTML:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/acceso.asp" -->
<%
If (Request.QueryString("Search") <> "") Then 
  Search = Request.QueryString("Search")
End If

If (Request.QueryString("go") <> "") Then 
  go = Request.QueryString("go")
End If

%>
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<script language="JavaScript" type="text/JavaScript">

function ventanaG(URL,ancho,alto) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+ ancho +',height='+ alto +',left = 400,top = 100');");
}

function nuevoAjax() { 
   /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por 
   lo que se puede copiar tal como esta aqui */ 
   var xmlhttp=false; 
   try    { 
      // Creacion del objeto AJAX para navegadores no IE 
      xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
   } 
   catch(e)    { 
      try       { 
         // Creacion del objet AJAX para IE 
         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
      } 
      catch(E) { xmlhttp=false; } 
   } 
   if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 
   return xmlhttp; 
} 

function cargaContenido() {
   	var valor=document.getElementById("buscar").value; 
   			ajax=nuevoAjax();
      		ajax.open("GET", "../buscador.asp?Ipla=1&buscar="+valor, true); 
			ajax.onreadystatechange=function()	{ 
					if (ajax.readyState==4) { 
						document.getElementById("fila_2").innerHTML=ajax.responseText; 
					}	
			}
      	ajax.send(null); 	
} 

</script>
</head>

<body>
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td valign="top">&nbsp;</td>
				<td><input type="text" id="buscar" name="buscar" size="20" onkeyup="cargaContenido()" ></td>
			</tr>
		</table>
		<input type="hidden" name="Search" value="form1">
	<table>
		<tr>
		<td bgcolor="#FFCC00" class="txContenido"><strong>MotivoII</strong></td>
   		<td id="fila_2" ></td> 
  	</tr>
	</table>
</body>
</html>
jahman está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 21:42.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93