<script>
$(document).ready(function() {
function Fun(a, b) {
this.name = a;
this.addr = b;
}
Fun.prototype.options = {};
$.extend(Fun.prototype.options, {
a : "a",
b : "b",
c : "c"
});
$.extend(Fun.prototype, {
show : function() {
alert("show__________" + this.name + "----" + this.addr);
}
});
Fun.prototype.test = {
"hello" : "kitty"
};
$.extend(Fun.prototype.test, {
"helloKitty" : function() {
},
"onPiece" : function(obj) {
alert(obj.name + "----------" + obj.addr);
},
"donaldDuck" : function() {
alert("helloWorld");
}
});
var fun = new Fun("pikachu", "dracula");
alert(fun.options.a);
fun.show();
fun.test.onPiece(this);

});
</script>

相关文章:

  • 2021-10-27
  • 2021-07-08
  • 2022-12-23
  • 2021-05-24
  • 2021-12-09
猜你喜欢
  • 2022-01-21
  • 2020-12-27
  • 2021-07-30
  • 2021-11-08
  • 2022-01-22
  • 2022-12-23
  • 2021-09-26
相关资源
相似解决方案