-1
I have a small jQuery function that checks which is the last registered ID in a database table.
However, I need to store the values in a variable and I realize that I can’t get the value generated by $.get
, The most I can get is a [object Object]
.
This was an attempt by several;
var ultimoRegistro = $.get("./core/consulta-unidades.php", function(data){
return data;
});
alert(ultimoRegistro);
I recommend you read What is a callback? and What is the real advantage of using a Callback and what is thread/multithread?
– Guilherme Nascimento