Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/10/2006, 05:33
Pastilla666
 
Fecha de Ingreso: septiembre-2005
Ubicación: Vejer de la Fra, Cádiz
Mensajes: 83
Antigüedad: 18 años, 8 meses
Puntos: 0
como creas el nuevo XMLHttpRequest, porque cada vez que lo creo nuevo se me para la pagina y no se sigue ejecutando, nose donde ponerlo nuevo.

Esta son las funciones que uso para ajax:

Cita:
var isWorking = false;

function admin(mostrar)
{
switch (mostrar)
{
case "mostrarCocinas":
{
var url = "mostrarCocinas.php";

if (!isWorking && http)
{
http.open("GET", url, true);
http.onreadystatechange = mostrarCocinasAdmin;
isWorking = true;
http.send(null);
}

break;
}
case "mostrarProductos":
{
var url = "mostrarProductos.php";

if (!isWorking && http)
{
http.open("GET", url, true);
http.onreadystatechange = mostrarProductosAdmin;
isWorking = true;
http.send(null);
}
break;
}
}
}

function getHTTPObject()
{
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
xmlhttp = false;
}
}
@else
xmlhttp = false;

@end @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
try
{
xmlhttp = new XMLHttpRequest();
}
catch (e)
{
xmlhttp = false;
}
}

return xmlhttp;
}

var http = getHTTPObject(); // We create the HTTP Object
Muchas Gracias.

Última edición por Pastilla666; 31/10/2006 a las 11:45