I need to implement jQuery code on Facebook API event. Facebook API code must be placed before html code and also not inside jQuery function and calling jQuery function would be anonymous function
, so I decided to create global variable, the true
value of which would call the function. The problem is that the value of variable is not changed thought alert() function works in the same place of code.
Variable is defined at the very top of code just after script opens
var not_logged_show_wall = false;
so as part of Facebook API there is else condition and alert works inside it, but value of the variable is not changed
else{
alert();
not_logged_show_wall = true;
}
I checked that it's not changed by another alert in js code after html code(while the code higher was before). Also tried the same thing with $(document).ready()
No error in console log. What is wrong?