window.onload = function() {
window.onfocus = alert('example');
}
I've met this problem, anyone can help? I'm new at javascript and made this expecting to work properly, but it does not :)
I want to alert the word "example" when the page is fully loaded and active, but don't want to alert the word "example" if the page is fully loaded but not active (onblur
).
And when user comes back (onfocus
) then alert "example".