a little misunderstanding with JQuery and JS variables. Simple example:
function someFunc(){
var flag = true;
$(function(){
$.post("/some/address/", {} ,function(data){
if( data == false){
flag = false;
}
});
});
if(flag == false){
return false;
}
}
The main problem is accessibility of variable flag in Jquery functions. I always get the same flag value equal to true. How to make this done ? How to make global variable to be visible for JS and JQuery ?