Created
June 17, 2011 12:26
-
-
Save bonyiii/1031331 to your computer and use it in GitHub Desktop.
prototype class.create in jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* http://flydillonfly.wordpress.com/2011/05/06/writing-oo-javascript-using-jquery/ */ | |
| var Flat = function () {}; | |
| Flat.prototype = { | |
| initialize: function () { | |
| $("#myButton").click($.proxy(this.displayMessage, this)) | |
| }, | |
| add: function(e) { | |
| } | |
| replace_ids = function(s){ | |
| var new_id = new Date().getTime(); | |
| return s.replace(/NEW_RECORD/g, new_id); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment