Hi Gafa,
You cant return it like this.
You have to make your processing into the onsuccess callback.

So... create a function and use it inside your onSuccess callback, or make
your hole logic into the callback method (maybe bad).




--
Fábio Miranda Costa
Solucione Sistemas
Front-End Engineer
http://meiocodigo.com


On Fri, Aug 7, 2009 at 4:00 PM, Gafa <[email protected]> wrote:

>
> How do I return the onsuccess resonsetext back to the function?
>
> getDataJSON always returns undefined.
>
> function getDataJSON(psType,psParams)
> {
>    var sParms="someurl"+psType+psParams
>
>    var jsonRequest = new Request.JSON(
>    {
>        url: sParms,
>        noCache: true,
>        async: false,
>        onSuccess: function(searchResults){
>            return searchResults;
>        },
>        onFailure: function(errfail) {
>            alert(errfail);
>            return "";
>        }
>    }).send();
>
> }
>
> thanks for any help

Reply via email to