码迷,mamicode.com
首页 > 其他好文 > 详细

dojo事件

时间:2015-07-12 15:38:20      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:

<script type="text/javascript">

    var myFunction = function () {
       alert(this.foo);
    };
    var obj = {foo:"hello"};

    var boundFuc = dojo.hitch(obj, myFunction);
    myFunction();
    boundFuc();
    myFunction();
 
</script>

 

  var myObject = {
        foo: "bar",
        myHandler: function (evt) {
            //    this is very contrived but will do.
            alert("The value of ‘foo‘ is " + this.foo);
        }
    };

        //    later on in the script:
        dojo.query("#myNodes").forEach(function (node) {
            node.onclick = myObject.myHandler;
        });

http://dojotoolkit.org/documentation/tutorials/1.10/hitch/index.html

 

dojo事件

标签:

原文地址:http://www.cnblogs.com/myboke/p/4629224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!