22/10/2007, 08:09
|
| | Fecha de Ingreso: marzo-2007
Mensajes: 58
Antigüedad: 17 años, 7 meses Puntos: 0 | |
Re: Objeto Ajax y Firefox?? Suelo usar un código similar al que sigue, y no me ha dado problemas en Firefox:
Código:
//create the ajax coonnection
//for IE
var req = null;
if(window.ActiveXObject)
{
req = new ActiveXObject(”Microsoft.XMLHTTP”);
}
//for Firefox
else if(window.XMLHttpRequest)
{
req = new XMLHttpRequest();
}
//define the file requested
var url = document.form1.country.options[selected].value+”.xml”;
//define which function to deal with the result of the request
req.onreadystatechange = getCities;
//using Post or get method to send the request,we use get method here
req.open(”GET”,url, true);
//send request to the server
//there is a trick, when you don’t want to send any parameters
//you need to use null, otherwise, there will be some problem in Firefox
req.send(null);
|