$(..).click() annd getting access to other method

$(..).click() annd getting access to other method

Hi. My code in short like this:
function Class() {
  this.foo1=1;
  this.foo2=2;

  this.Init=function() {
    // create HTML and append to DOM here
    this.AddListeners();
  }

  this.AddListeners=function() {
    $('get existing element right').click() {
      this.DoSome();           // !!!!!
    }
  }

  this.DoSome=function() {
    console.log(this.foo2);
  }

}

var object=new Class();
object.Init();



Of cours function DoSome() not run.. I know why, but - what can I get access to this method from inner click() { } .. ?

Sorry for my english, it's not good ;))))
    • Topic Participants

    • spam