Use package name in function definition : Class Definition « Dojo toolkit « JavaScript Tutorial






<html>
  <head>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/"
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
  </head>
  <body>
    <script>

      function com() { }
      
      com.java2s = function() { };
      
      com.java2s.method1 = function() { return "method1 called"; }
      
      alert(dojo.getObject("com.java2s.method1")() + ", " +
        dojo.getObject("com.java2s.method2", true) + ", " +
        dojo.getObject("com.java2s.method2", false));

    </script>
  </body>
</html>








29.44.Class Definition
29.44.1.Extend class
29.44.2.Use dojo to create class
29.44.3.Use package name in function definition