Código:
pero al ejecutar getNum devuelve 0, pero al checar cuanto vale dato si me da el numero correcto, alguien sabe como poder asignar el valor de dato a la variable num?? function objeto(){
this.num=0;
this.contar = function (tabla){
$.get("registro.php",{tab:tabla},function (dato){
this.num = dato;
});
}
this.getNum = function (){
return this.num;
}
}




