Using jQuery inside functions.

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:
  1. object = {
  2.     var : 1,
  3.     fun : function()
  4.     {
  5.         var result = 0;
  6.         $.getJSON( 'page.json', function(data)
  7.         {
  8.             result = data.item;
  9.         });
  10.         this.var = result;
  11.     }
  12. }

Any help is appreciated.