Passing arguments from javascript

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing arguments from javascript

Annick
Hi,

        How is it possible to pass a javascript result to seaside ?

        I have successfully tried to use a hidden field as a vehicle, but is there a more elegant way ?

  html button
        id: html nextId;
        onClick: ((html jQuery id: 'toto' ) value: '3' );
        onClick: (html jQuery ajax callback: [:v | v inspect] value: (html jQuery id: 'toto') value);
        with: 'Click toto'.
    html hiddenInput id: 'toto’.

Annick
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Passing arguments from javascript

Esteban A. Maringolo
Hi all,

The #callback:value: message is the way to go.

But it doesn't have to be hidden, it could be any value, or even it
could be a JSON string that you parse on the other side.

Regards!

Esteban A. Maringolo

On Mon, Nov 2, 2020 at 10:54 AM Annick Fron <[hidden email]> wrote:

>
> Hi,
>
>         How is it possible to pass a javascript result to seaside ?
>
>         I have successfully tried to use a hidden field as a vehicle, but is there a more elegant way ?
>
>   html button
>         id: html nextId;
>         onClick: ((html jQuery id: 'toto' ) value: '3' );
>         onClick: (html jQuery ajax callback: [:v | v inspect] value: (html jQuery id: 'toto') value);
>         with: 'Click toto'.
>     html hiddenInput id: 'toto’.
>
> Annick
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside