I have a code with this structure
var no_data=false;
function checkdata(){
//reset of the global var
no_data=false
//some code that return an array, called data
if(data.length==0) no_data=true;
}
Then I execute the function checkdata() and check the var no_data to do an alert if it’s true, but It updates late, in the second time I call it :S
And I tried to return in the function the errors, like no data etc, but It wont work :S
Maybe is a problem of compatibility of global scope with the livequery jquery plugin?
If you want to update
no_databefore execution of functioncheckdata.then update it just before call of function
checkdata.