js中的方法调用

时间:2015-02-01 21:39:10   收藏:0   阅读:250
<script>
    var m = {com: { sao: {citi:{}}}};
    m.com.sao.citi.init = new function() {
        this.name = "roboce";
        this.callname = function() {
            console.log(this.name);
        };
        
        this.haha = function() {
            callname(); // this.callname();
        };
    };
    
    function callname() {
        console.log("mmmm");
    }
    
    m.com.sao.citi.init.haha();
</script>

 

原文:http://www.cnblogs.com/daishuguang/p/4266042.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!