Skip to content

Instantly share code, notes, and snippets.

@bonyiii
Created June 17, 2011 12:26
Show Gist options
  • Select an option

  • Save bonyiii/1031331 to your computer and use it in GitHub Desktop.

Select an option

Save bonyiii/1031331 to your computer and use it in GitHub Desktop.
prototype class.create in jquery
/* 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