Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/03/2007, 19:13
Avatar de MaBoRaK
MaBoRaK
 
Fecha de Ingreso: abril-2003
Ubicación: La Paz - Bolivia
Mensajes: 2.003
Antigüedad: 21 años
Puntos: 35
Re: HTTPRequest, onreadystatechange y llamados simultaneos

loading.............


_ajax.onreadystatechange= functionCallBack(_ajax);

eso está mal porque no asignas una funcion de retorno sino un retorno de funcion a onreadystatechange, ahora para no perder la encapsulacion deberias hacer

Código PHP:
function sendAjax(page,paramsfunctionCallBack)
{
var    
_ajax CrearAjax(); 
 
_ajax.open('get',page+'?'+params,true);
 
_ajax.setRequestHeader('Content-Type''application/x-www-form-urlencoded');
 
_ajax.onreadystatechangefunctionCallBack;
 
_ajax.send(null);

o bien

Código PHP:
function sendAjax(page,paramsfunctionCallBack)
{
var    
_ajax CrearAjax(); 
 
_ajax.open('get',page+'?'+params,true);
 
_ajax.setRequestHeader('Content-Type''application/x-www-form-urlencoded');
 
_ajax.onreadystatechange= function()
                                          {
                                               
functioncallBack(_ajax);
                                          };
 
_ajax.send(null);


connection closed.
__________________

Maborak Technologies