87,910
社区成员
发帖
与我相关
我的任务
分享
function ok()
{
}
function init()
{
ok1= new ok()
ok1.f1=function(){alert(123)}
ok.prototype.f1=function(){alert(321)}
ok1.f1();
//大家看,这里创建的两个f1方法.有什么不一样的?
}
window.onload=init;
function ok()
{
}
function init()
{
ok1= new ok()
ok1.f1=function(){alert(123)}
ok.prototype.f1=function(){alert(321)}
ok1.f1();
ok2 = new ok();
ok2.f1();
}