Código Javascript:
 Y cuando alerto a store me muestra undifinied Ver original
function nuevoAjax()
{
var xmlhttp=false;
try
{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E) { xmlhttp=false; }
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); }
return xmlhttp;
}
var store;
function setstore(dat){
store = dat
}
var Ajax=nuevoAjax();
Ajax.open("POST","test.xml", true);
Ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
Ajax.send('do=c');
Ajax.onreadystatechange=function()
{
if (Ajax.readyState==4 && Ajax.status == 200){
Respuestas=Ajax.responseXML;
Comprobacion = Respuestas.getElementsByTagName("test")[0].childNodes[0].data;
setstore(Comprobacion);
}
}
alert(store)
 , según yo la variable store es de tipo global.
, según yo la variable store es de tipo global.Espero sus comentarios... Mil gracias de antemano.
 
 
 Problema: variable fuera de una función ajax
 Problema: variable fuera de una función ajax 

 Respuesta: Problema: variable fuera de una función ajax
 Respuesta: Problema: variable fuera de una función ajax 


 
 

