]> git.pond.sub.org Git - eow/blobdiff - static/dojo-release-1.1.1/dojo/tests/_base/_loader/addLoadEvents.html
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojo / tests / _base / _loader / addLoadEvents.html
diff --git a/static/dojo-release-1.1.1/dojo/tests/_base/_loader/addLoadEvents.html b/static/dojo-release-1.1.1/dojo/tests/_base/_loader/addLoadEvents.html
new file mode 100644 (file)
index 0000000..53e669f
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+       "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+       <head>
+               <title>Testing dojo.addOnLoad() and dojo.addOnUnload()</title>
+               <script type="text/javascript" 
+                       src="../../../dojo.js" djConfig="isDebug: true"></script>
+               <script type="text/javascript">
+                       dojo.addOnLoad(function(){
+                               console.debug("addOnLoad(func) works");
+                       });
+                       var scope = {
+                               named: function(){ console.debug("addOnLoad(obj, name) works"); },
+                               refd: function(){ console.debug("addOnLoad(obj, func) works"); }
+                       };
+                       dojo.addOnLoad(scope, "named");
+                       dojo.addOnLoad(scope, scope.refd);
+                       // dojo.addOnLoad(scope, "named");
+                       // dojo.addOnLoad(scope, scope.refd);
+
+                       dojo.addOnUnload(function(){
+                               alert("addOnUnload works");
+                       });
+               </script>
+       </head>
+       <body>
+               <h1>Testing dojo.addOnLoad() and dojo.addOnUnload()</h1>
+
+               <p>This page has registers a function with dojo.addOnLoad() and dojo.addOnUnload.</p>
+               
+               <p><b>dojo.addOnLoad()</b>: You should see an alert with the page first loads ("addOnLoad works").</p>
+               
+               <p><b>dojo.addOnUnload()</b>: You should see an alert if the page is reloaded, or if you navigate to a 
+               different web page ("addOnUnload works").
+       </body>
+</html>
+