Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/02/2013, 06:54
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 17 años, 8 meses
Puntos: 1567
Respuesta: funciona solo can alert javascript

que ajax necesita el tiempo que le proporciona la demora provocada por un alert???


Buscador() esta definido??

quizá esté definido, pero tenga un error, de todas maneras como NO está explícita, vamos a inventar un poco

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <script type="text/javascript">
  8. //<![CDATA[
  9. var ajax;
  10. function Buscador(){
  11.  var xmlHttp=null;
  12.  if (window.ActiveXObject)
  13.    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  14.  else
  15.    if (window.XMLHttpRequest)
  16.      xmlHttp = new XMLHttpRequest();
  17.  return xmlHttp;
  18. }
  19.  
  20. function mando_pcto(){
  21.  
  22.  
  23. //alert("VERIFIQUE ADICIONALES");
  24. ajax = Buscador();
  25. var Resultados = document.getElementById('resultado_adicionales');
  26. ajax.open("GET","hola.html");
  27. ajax.onreadystatechange = function()
  28. {
  29. if (ajax.readyState == 4){
  30. Resultados.innerHTML = ajax.responseText;
  31. }
  32. }
  33. ajax.send(null)
  34. }
  35.  
  36. //]]>
  37.  
  38.  
  39. </head>
  40.     <button onclick="mando_pcto();">llamar fnc</button>
  41. <div id="resultado_adicionales"></div>
  42. </body>
  43. </html>

hola.html

Código HTML:
Ver original
  1.     hola
  2. </html>

Funciona con ó sin alert()

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.