> function isTracked(personcode, callback) {
> $.get('trackstudent/istracked.php', {'personcode': personcode}, callback);
>
> }
>
> isTracked(code, function(tracked) {
> // do something with tracked, exactly as you would have done above.
>
> });
I thought that I understand that but Im doing something wrong.
(istracked.php has 'true' or 'false')
-------
var r;
function isTracked(personcode, callback)
{
$.get('trackstudent/istracked.php',{'personcode': personcode},
callback);
return r;
}
$(document).ready(function() {
alert(isTracked('10591891',function(data) {
r=data;
}));
});
----
istracked.php returns 'true'
result of alert: undefined
should be: true
Callback is still running last .
I have no idea for that :/
TIA
Michael