October 2008
Beginner to intermediate
544 pages
13h 21m
English
The onfocus and onblur handlers are mirror images of each other. While they may sound like what happens when you’ve been working on JavaScript too late at night, in reality, the onfocus handler triggers when a page becomes the front-most active window. Scripts 9.5 and 9.6 catch the onfocus handler and force the page to always go to the back (Figure 9.3).
1. | window.onfocus = moveBack; |
2. | function moveBack() {
self.blur();
} |
Read now
Unlock full access