javascript 面向对象OOP笔记

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>OOP</title>
    <script type="text/javascript">
        function myOOP() {
            alert(this.a);
            alert(this.b);
        }
        var a = 12;
        window.b = 2;
        window.onload = function()
        {
            var c = [1,2,3,4,5,6];
            var d = 7;
            c.e = 8;
            c.f = function () {
                alert(this.e);
            };
            c.f();
            this.myOOP();
            window.myOOP();
            myOOP();
        };
    </script>
</head>
<body>
</body>
</html>

 

posted @ 2017-11-01 17:14  我将枕中记忆抹去任岁月浮光掠影  阅读(141)  评论(0编辑  收藏  举报