Is this the right way of doing things. Also here i am passing around this context via _this is there a better way of doing it
var messages = {
getLoadMore : function(_this){
...............
},
getSwappingData : function(_this){
.................
},
}
jQuery('.js-message-swap').live('click', function(){
_this = jQuery(this);
messages.getSwappingData(_this);
return false;
});
What you have will work fine. A shorter version would be to pass the reference of the function to the
clickhandler, which will then applythisto the external function. Try this: