<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<html lang="en">
<head>
<title>Window Focus Listener Test</title>
</head>
<body class="yui3-skin-sam">
<!-- Initialization process //-->
<script type="text/javascript">
// ,
// filter: 'debug',
// combine: false,
// useConsole: true,
// logExclude: {deprecated: 1,
// Dom: true, Selector: true, Node: true, attribute: true, base: true, event: true, widget: true}
YUI({
lazyEventFacade: true
}).use('console', 'event-focus', function (Y) {
(new Y.Console()).render();
var win = Y.one(window);
win.on("focus", function (e) {
Y.log("First focus listener called");
});
win.on("blur", function (e) {
Y.log("First blur listener called");
});
Y.on("focus", function (e) {
Y.log("Second focus listener called");
}, window);
Y.on("blur", function (e) {
Y.log("Second blur listener called");
}, window);
});
</script>
</body>
</html>