/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Use with prototype 1.6 var Person = Class.create({ initialize: function(){ //Create a Hash for information store this.info = $H(); } , setName: function(name){ this.info.set("name",name); } , getName: function(){ return this.info.get("name"); } , setSurname: function(surname){ this.info.set("surname",surname); } , getSurname: function(){ return this.info.get("surname"); } , toJSON: function(){ return this.info.toJSON(); } });