Using jQuery inside functions.
Hi, I'm making a system in JavaScript and I try to put evertyhing inside objects as much as possible to keep it simple. The problem I have is that I can't really figure out how to reffer to a child when I'm using jQuery.
Example:
-
object = {
-
var : 1,
-
fun : function()
-
{
-
var result = 0;
-
$.getJSON( 'page.json', function(data)
-
{
-
result = data.item;
-
});
-
this.var = result;
-
}
-
}
Any help is appreciated.