I\'ve got a problem concerning the javascript \"this\" keyword when used within a javascript functional object. I want to be able to create an object for handling a Modal po
CreateItemModal.prototype.show = function() {
var me = this;
this.$wrapper.dialog({
buttons: {
// this crashes because this is not the current object here
Cancel: me.close
}
});
};
The reason why it doesn't work, because the "this" is referring to the dialog, not to that class.