that's normal,
the function does not wait the request to complete before it returns.


On Thu, Feb 19, 2009 at 4:39 PM, websam <[email protected]> wrote:

>
> Hi there,
>
> I'm creating a class to display data in a table. In my class i have
> this function:
>
> loadJSON: function(url) {
>    this.result = null;
>    new Request.JSON({
>        url: url,
>        method: 'get',
>        onSuccess: function(json) {
>            this.result = json;
>        }
>    }).send();
>    return this.result;
> }
>
> Now if i alert the result retuned from the function with alert
> (this.loadJSON(this.options.dataUrl)); It simply alrtes "null".
>
> What am i missing here ?




-- 
fax : (+33) 08 26 51 94 51

Reply via email to