Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MyObject( options )
- {
- this.x = options.x;
- }
- MyObject.prototype.someFunction=function someFunctionF()
- {
- return this.x + 1;
- }
- var opts = { x: 99 };
- var myObject = new MyObject( opts );
- function MyObject(options) { this.x = options.x; }
- MyObject.prototype.someFunction = function() { return this.x + 1; }
- MyObject.create(id, options) {
- if (!this._instances) this._instances = {};
- return this._instances[id] = new MyObject(options);
- }
- MyObject.getInstance(id) { return this._instances[id]; }
- MyObject.create(ClientID, {x: 99});
- String.Format("onclick="MyObject.getInstance('{0}').someFunction()", ClientID);
- function MyObject( options ) { MyObject.x = options.x; }
- MyObject.x = 99; // static
- MyObject.prototype.someFunction = function () { return MyObject.x + 1; }
Add Comment
Please, Sign In to add comment