Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/07/2015, 14:13
PHPeros
Colaborador
 
Fecha de Ingreso: septiembre-2013
Ubicación: España
Mensajes: 3.648
Antigüedad: 10 años, 8 meses
Puntos: 578
Respuesta: Creacion de ajax

Para inicializar un objeto AJAX te recomiendo usar el siguiente código, ya que el que utilizas está un poco desfasado:

Código Javascript:
Ver original
  1. function nuevoAJAX(){
  2.   var xmlhttp;
  3.   if (window.XMLHttpRequest) { // IE7+, Firefox, Chrome, Opera, Safari
  4.     xmlhttp = new XMLHttpRequest();
  5.   }
  6.   else { // IE6, IE5
  7.     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  8.   }
  9.   return xmlhttp;
  10. }

Simplemente llamas a la función y realizas la petición usando el objeto xmlhttp retornado.