Difference between revisions of "User:Michael S. Serfas/Sandbox"

From OpenWetWare
Jump to: navigation, search
(Basic dump: what's in this version of Mediawiki? (e.g. use of legacy Javascript globals, no mw. object))
(No difference)

Revision as of 15:28, 24 July 2013

<html> <script> //[CDATA[ function explore(something, level) {

   if (level > 0) {
       document.write(level+":"+something);
       document.write("<br />");
       if (typeof something == "object") {
           for (i in something) {  
               explore(something[i], level - 1);
           }
       }
   } else {
       document.write("...");
   }

}

explore(window, 10); //]] </script> </html>