$(function () {
var userNameAlter=createPopup("alert","驗證");
});
function createPopup(type,text){
var o=new Object();
o.content=text;
o.show=function () {
alert("顯示");
}
if(type=="alert"){
o.show();
}
if(type=="promot"){
}
if(type=="confirm"){
}
return o;
}
通過寄生式繼承得到純淨的對象,雖然這個模式有很多的不足