You can declare a reference to your main object.
It will be usable in all deeper scopes :
function classname() {
var mainvar =new Array(example,array);
var myreference = this;
this.functionname = function() {
$('td.number').each(function(_i) {
In this particular snippet you just need to reference mainvar instead
of this.mainvar.
...
$(this).html(mainvar[_i]);
...
If you declared mainvar like this:
...
this.mainvar = new Array(example, array);
...
Then you would just need to create a reference to the original 'this'
object to
Works great, thanks
3 matches
Mail list logo