js 面向对象的语法示例

    技术2022-05-13  16

    func.js

     var people = {        getName:function(name){         return name;        },        getAge:function(age) {         return age;        }    };

     

     

    test.htm

    <script type="text/javascript" src="func.js"></script>

    <script>alert(people.getName("tom"));

    </script>


    最新回复(0)