首页 > 其他 > 详细

dojo事件

时间:2015-07-12 15:38:11      阅读:125      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!