<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>Todoist</title>
    <script>
        function Douban(){
            Douban.val = "test";
            Douban.prototype.test = function(name){
                alert("hello "+name);
            }
            Douban.testA = function(name){
                alert("hello "+name);
            }
        };
    </script>
</head>
<body>
<script>
    var douban = new Douban();
    alert(Douban.val);
    douban.test("中国");
    Douban.testA("中国");
</script>
</body>
</html>
直接设的可以直接调用,使用prototype的,需要有一该类的对象。
	posted on 2008-10-30 17:37 
Vincent.Yu 阅读(269) 
评论(0)  编辑  收藏