AJAX múltiples llamadas al mismo tiempo, no conseguir que funcione

  • Zeroastic
  • Born
  • Born
  • No Avatar
  • Registrado: Oct 11, 2008
  • Mensajes: 1
  • Status: Offline

Nota Octubre 11th, 2008, 9:57 am

Hola!

Alguien intenta llamar AJAX múltiples llamadas al mismo tiempo.

El problema es que sólo el último parece llamada a actualizar la página correctamente.
ANY1 que me podría ayudar =>?

Este es mi código:

var xmlHttps, xmlHttps1, xmlHttps2, sTargetDiv, targeturl, getvar1;


función ajax (getURL, divtagg, get1, get2, get3, get4, get5)
(
XMLHTTP GetXmlHttpObject = ();

if (XMLHTTP == null)
(
alert ( "Din webläsare stödjer integración ajax. Byt hasta el IE 7. 0, firefox, safari eller ópera. ");
retorno;
)

sTargetDiv = divtagg
targeturl = getURL
getvar1 = get1
var url = targeturl + "? get1 =" + + get1 "get2 =" + + get2 "get3 =" + + get3 "get4 =" + + get4 "get5 =" + + get5 "sid =" + Math.random ();
xmlHttp.onreadystatechange = stateChanged;
document.getElementById (sTargetDiv). innerHTML = "<img src=loading.gif>";
XMLHTTP. abierto ( "GET", url, true);
xmlHttp.send (null);
)



stateChanged función ()
(
if (xmlHttp.readyState == 4 | | xmlHttp.readyState == "completa")
(
document.getElementById (sTargetDiv). innerHTML = xmlHttp.responseText
if (xmlHttp. responseText == "Bilden togs Bort")
(
removeByID ( "imagen" + getvar1)
)
)
)

GetXmlHttpObject función ()
(
XMLHTTP var = null;

intentar
(
/ / Firefox, Opera 8.0 +, Safari
XMLHTTP = new XMLHttpRequest ();
)
de capturas (e)
(
/ / Internet Explorer
intentar
(
XMLHTTP = new ActiveXObject ( "Msxml2. XMLHTTP ");
)
de capturas (e)
(
XMLHTTP = new ActiveXObject ( "Microsoft.XMLHTTP");
)
)

XMLHTTP regreso;
)

función ajaxPro (geturl1, divtagg1, geturl2, divtagg2)
(
AJAX (geturl1, divtagg1, 1);
Ajax (geturl2, divtagg2, 2);
)
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 11th, 2008, 9:57 am

Publicar Información

  • Total de mensajes en este tema: 1 mensaje
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 64 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC