1

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 2 <html>
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 5 <title>Tutorial: Hello Dojo!</title>
 6 </head>
 7 <body>
 8     <h1 id="greeting">Hello</h1>
 9     <script src="dojo/dojo/dojo.js"    data-dojo-config="async: true"></script>
10     <script type="text/javascript">
11         require(['dojo/_base/declare'],function(declare){
12             
13             declare('aClass',null,{
14                  add: function (num1, num2) {    //类方法
15                         return num1 + num2;
16                  }       
17             });
18             var m = new aClass();
19             alert(m.add(2,3));
20         });
21     </script>
22 </body>
23 </html>

 

posted on 2016-12-30 14:21  Sharpest  阅读(160)  评论(0编辑  收藏  举报