How to find out in javascript whether the browser window is active or not

Practice




How to find out in javascript whether the browser window is active or not

var active = true;
window.onblur = function () {
active = false;
}
window.onfocus = function () {
active = true;
}

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone