Skip to content

Instantly share code, notes, and snippets.

@yuxel
Created November 22, 2013 12:46
Show Gist options
  • Select an option

  • Save yuxel/7599323 to your computer and use it in GitHub Desktop.

Select an option

Save yuxel/7599323 to your computer and use it in GitHub Desktop.
var Sahi = function () {
var that = this;
console.log(this);
that.msg = "Burasi Class";
that.clickBindEt = function () {
console.log('class this ', this);
this.go = function () {
console.log('go ', this);
console.log(this == that);
};
$("body").click(function () {
console.log('icerdeki this ', this);
alert(that.msg);
that.go.apply(this);
that.go();
});
return that;
};
};
var sahi = new Sahi();
sahi.clickBindEt().go();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment