chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] ajax egg


From: felix winkelmann
Subject: Re: [Chicken-users] ajax egg
Date: Tue, 20 Sep 2005 03:37:24 -0700

On 9/20/05, Daishi Kato <address@hidden> wrote:
> 
> Hmm, (current-request) just gives me #f.
> I will take a more look into it.

Oh, I should mention that `current-request' only works in .ssp
pages or in request-handlers defined via `define-http-resource'.

> 
> Do you know any way to pass events as parameters?
> I would like to get key code that a user pressed in a browser.

Use the 'arguments:' keyword argument to add URL-encoded arguments
to remote requests. Probably it's easier to write some javascript that
invokes a raw URL generated with `remote-url'. I alo recommend
taking a peek at the prototype.js code, it's quite clean.

> 
> BTW, here is a little fix:
> 
> --- ajax.scm.orig       2005-08-25 04:37:36.000000000 +0900
> +++ ajax.scm    2005-09-20 19:07:25.000000000 +0900
> @@ -103,7 +103,7 @@
>  (define (remote-button text thunk . more)
>    (let ((out (apply remote-action thunk more)))
>      (case (ajax-output-format)
> -      ((html) (sprintf "<button onclick=\"~a\">~a</a>" out text))
> +      ((html) (sprintf "<button onclick=\"~a\">~a</button>" out text))
>        (else `(button (@ (onclick ,out)) ,text)) ) ) )
> 
>  (define (remote-timer freq thunk . more)
> 

Thanks a lot.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]