GitHub 博客园 Nanakon

☀【JS组织】pageA_init, pageB_init

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
    <script>
        var Bear = function() {
            return {
                f1: function() {
                    console.log('f1')
                },
                f2: function() {
                    console.log('f2')
                },
                f3: function() {
                    console.log('f3')
                },
                pageA_init: function() {
                    var that = this
                    that.f1()
                    that.f3()
                },
                pageB_init: function() {
                    var that = this
                    that.f2()
                }
            }
        }()
    </script>
    <script>
        Bear.pageA_init()
    </script>
</body>
</html>

 

posted on 2013-11-07 06:20  jzm17173  阅读(198)  评论(0)    收藏  举报

导航

轻音