js中的方法调用

<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>

 

posted @ 2015-02-01 20:31  daishuguang  阅读(347)  评论(0编辑  收藏  举报