Я внутри объекта javascript (vr roxx:)), но каждый раз, когда я связываю событие с jQuery, я должен включать контекст экземпляра основного объекта через параметр данных, чтобы работать с ним. Не существует ли простой/опрятный способ сделать это в jQuery?
var oink =
{
pig: null,
options:
{
showPigMom: 0
},
init: function(pigObj)
{
//Show the pigmom
$(this.doc).bind('keyup click', {o: this}, function(e)
{
var o = e.data.o;
if (o.options.showpath)
o.doWhatever();
});
...