Created
July 23, 2009 10:09
-
-
Save dmitry/152649 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _that = this; | |
jQuery.extend({ | |
someFunction: function(onSomeEvent) { | |
var variable = 'some text'; | |
onSomeEvent.apply(_that); // how to pass current scope variables/functions to this function? | |
return null; | |
function _someMethod(arg) { | |
console.log(arg); | |
} | |
} | |
}); | |
jQuery.someFunction(function(){ | |
console.log(this.variable); // or console.log(variable); | |
console.log(this._someMethod(1)); // or jQuery.someFunction._someMethod(2); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment