看看下面的代码就明白了。<script type="text/javascript">
//1,直接调用window.onload=function(){
alert("直接调用");
}//2,普通调用test1=function(){
alert("用名字调用");
}test1();//3,参数调用test2=function(a,b){
alert("参数:"+a+","+b);
}test2("arg1","arg2");function func(){
this.notice=function(){
alert("作为对象的方法调用");
}
}
var a=new func();
a.notice();
</script>