]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojo/tests/_base/_loader/addLoadEvents.html
Comment class stub
[eow] / static / dojo-release-1.1.1 / dojo / tests / _base / _loader / addLoadEvents.html
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() and dojo.addOnUnload()</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.addOnLoad(scope, "named");
17                         dojo.addOnLoad(scope, scope.refd);
18                         // dojo.addOnLoad(scope, "named");
19                         // dojo.addOnLoad(scope, scope.refd);
20
21                         dojo.addOnUnload(function(){
22                                 alert("addOnUnload works");
23                         });
24                 </script>
25         </head>
26         <body>
27                 <h1>Testing dojo.addOnLoad() and dojo.addOnUnload()</h1>
28
29                 <p>This page has registers a function with dojo.addOnLoad() and dojo.addOnUnload.</p>
30                 
31                 <p><b>dojo.addOnLoad()</b>: You should see an alert with the page first loads ("addOnLoad works").</p>
32                 
33                 <p><b>dojo.addOnUnload()</b>: You should see an alert if the page is reloaded, or if you navigate to a 
34                 different web page ("addOnUnload works").
35         </body>
36 </html>
37