Re: Prototype callbacks: return a value

Frederick Polgardy
Mon, 30 Jun 2008 10:52:57 -0000

FYI, what you''re doing in this example is setting the value of lucas to
the
function processRSS immediately, and then handing that value to Ajax.Request
as the onComplete handler.  Syntactically it may look like it''s
performing
the assignment in the callback, but it isn''t.

-Fred

On Mon, Jun 30, 2008 at 3:51 AM, ljundie
<ljundie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

>
> var lucas = 0;
>
> function loadRSS() {
>         var url = "sample_feeds/sample_feeds_TTblog.xhtml";
>         var myAjax = new Ajax.Request( url, {
>
>    method: ''get'',
>
>    parameters: '''',
>
>    onComplete: lucas = processRSS
>
>    });
>         }
>

--
Science answers questions; philosophy questions answers.