Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2010, 05:56
Leogl
 
Fecha de Ingreso: noviembre-2009
Mensajes: 113
Antigüedad: 14 años, 5 meses
Puntos: 0
Definir Tipo de Datos de Busqueda.

hola con esta pregunta reemplazo la anterior publicacion.
Esta js, funciona cuando el tipo de datos son numeros, pero cuando hay letras no.
que debo ajustar en el para que me tome ambos tipos.

Código Javascript:
Ver original
  1. // JavaScript Document
  2. function  nuevoAjax(){
  3.     var xmlhttp=false;
  4.     try{
  5.         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  6.     }catch(e){
  7.         try {
  8.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  9.         }catch(E){
  10.             xmlhttp = false;
  11.         }
  12.     }
  13.  
  14.     if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  15.         xmlhttp = new XMLHttpRequest();
  16.     }
  17.    
  18.     return xmlhttp;
  19. }
  20.  
  21. function buscarDato(){
  22.     resul = document.getElementById('resultado');
  23.     bus=document.frmbusqueda.dato.value;
  24.    
  25.     ajax=nuevoAjax();
  26.     ajax.open("POST", "busqueda.php",true);
  27.     ajax.onreadystatechange=function() {
  28.         if (ajax.readyState==4) {
  29.             resul.innerHTML = ajax.responseText
  30.         }
  31.     }
  32.     ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  33.     ajax.send("busqueda="+bus)
  34.  
  35. }