source: Dev/trunk/src/client/dojo/tests/_base/loader/addLoadEvents.html

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.5 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2        "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4        <head>
5                <title>Testing dojo.addOnLoad(), dojo.addOnUnload() and dojo.addOnWindowUnload()</title>
6                <script type="text/javascript"
7                        src="../../../dojo.js" djConfig="isDebug: true"></script>
8                <script type="text/javascript">
9                        dojo.addOnLoad(function(){
10                                console.debug("addOnLoad(func) works");
11                        });
12                        var scope = {
13                                named: function(){ console.debug("addOnLoad(obj, name) works"); },
14                                refd: function(){ console.debug("addOnLoad(obj, func) works"); }
15                        };
16                        dojo.ready(scope, "named");
17                        dojo.addOnLoad(scope, scope.refd);
18                        // dojo.addOnLoad(scope, "named");
19                        // dojo.addOnLoad(scope, scope.refd);
20
21                        dojo.addOnWindowUnload(function(){
22                                alert("addOnWindowUnload works");
23                        });
24
25                        dojo.addOnUnload(function(){
26                                alert("addOnUnload works");
27                        });
28                </script>
29        </head>
30        <body>
31                <h1>Testing dojo.addOnLoad(), dojo.addOnUnload() and dojo.addOnWindowUnload()</h1>
32
33                <p>This page has registers a function with dojo.addOnLoad(), dojo.addOnUnload() and dojo.addOnWindowUnload.</p>
34               
35                <p><b>dojo.addOnLoad()</b>: You should see 3 console messages about addOnLoad working.</p>
36               
37                <p><b>dojo.addOnUnload()</b>: You should see an alert if the page is reloaded, or if you navigate to a
38                different web page ("addOnUnload works").</p>
39               
40                <p><b>dojo.addOnWindowUnload()</b>: You should see an alert if the page is reloaded, or if you navigate to a
41                different web page ("addOnWindowUnload works").</p>
42               
43        </body>
44</html>
45
Note: See TracBrowser for help on using the repository browser.