Is there a way that when I click on my browser, and give it focus, to run a method once? And then when the browser loses focus and then gets the focus back to again run that
$(document).ready(function() { $(window).one("focus", SomeFocusMethod); } ); var SomeFocusMethod = function() { // do stuff $(window).one("blur", SomeBlurMethod); } var SomeBlurMethod = function() { // do stuff $(window).one("focus", SomeFocusMethod); }