Javascript function gets incorrect boolean value from controller
When the page loads, the {!myBoolean}
expression gets the value of myBoolean at the time of the page load. So essentially the javascript function in your page would be:
function myFunction(){
window.alert(false);
}
If the value of myBoolean is changed in the controller, you would also have to rerender the javascript function, or else it would remain as alert(false);
Moving the javascript function inside the something
block should solve your problem.