dojo学习日记(3)——on,lang用法 construct很重要哦

来源:互联网 发布:剑三苍云捏脸数据成男 编辑:程序博客网 时间:2024/06/18 03:58
1.on的用法
     on(this.btnDiscover, 'click', lang.hitch(this, '_onBtnDiscoverClick'));
2.lang的用法
     
// define an object
varfoo = {
bar: { }
};
 
// search the global scope
lang.exists("foo.bar");// true
lang.exists("foo.bar.baz");// false
 
// search from a particular scope
lang.exists("bar", foo); // true
lang.exists("bar.baz", foo); // false

on(this.btnDiscover, 'click',lang.hitch(this, '_onBtnDiscoverClick'));
3.对于index.html通常js都有一个construct function 用来初始化变量,并且将页面的变量绑定一些方法。
0 0