My JS code behaves in a strange way. I use $.tGET to get some JSON data. It works fine like this:
let UserCssLocal = "dd";
$.tGET('style',{username: text},function(r){
UserCssLocal = r.css;
});
If I add window.alert(UserCssLocal); inside the $.tGET it works perfectly; but if I do it after the $.tGet it keep showing the "dd". How do I fix this? I feel confused!