随笔 - 8  文章 - 24  trackbacks - 0
<2008年10月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用链接

留言簿(4)

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

<!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 阅读(225) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: