<body>
<script type="text/javascript">
var classa=
{
A:function(){ alert("this is function a");},
B:function(){ alert("this is function b");}
};
classa.A();
classa.B();
var classb=function()
{
function aa()
{
alert("this is function aa");
}
function bb()
{
alert("this is function bb");
}
this.aa=aa;
this.bb=bb;
}
var a=new classb();
a.aa();
a.bb();
function classc()
{
function cc()
{
alert("this is function cc");
}
{
cc();
alert("这是构造函数!!");
}
}
var cc=new classc();
</script>
</body>
写这段代码主要是想让自己了解上面这几种写法,写法很简单,但是很实用......记下了