Código:
de hecho, copié y pegué un código anterior muy similar, pero no quiere funcionar, y no logro identificar el error. function nuevoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
try{
xmlhttp = new XMLHttpRequest();
} catch(E2){
xmlhttp = false;
}
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function resAjax(id_prod){
aj=nuevoAjax();
aj.open("POST", "aj_detprod.php?id_prod="+id_prod, true);
var ladesc;
aj.onreadystatechange=function(){
// desde aca ya no me funciona
if(aj.readyState==4) {
ladesc = aj.responseText;
}
}
return ladesc;
aj.send(null);
}
Alguien nota algo malo en el código?
salu2

