In my JavaScript code, I am creating an object:
var t = null;
$.getJSON('http://localhost:53227/Home/GetData', function (data) {
alert(data);
t = data;
});
alert(t);
After alerting data, I receive an object, but when I alert t, it shows null.
Could someone provide guidance on how to assign the returned data to "t"?