I am trying to create an object and assign click handlers from it. I realized that I could not do this, because "this" becomes associated with the button, and not with the object literal, violating access to functions.
"Uncaught TypeError: Object # does not have a 'clearSelection' method"
See below script.
http://jsfiddle.net/ebKk8/
And here is the code for reference. At this point, he should not do anything useful except to illustrate the problem :)
function ThingConstructor(someData) { var button = $("#someButton"); return { initialise: function () { button.click(function () {
source share