[Seaside] Javascript calls through jQuery

Johan Brichau johan at inceptive.be
Mon Mar 3 07:07:29 UTC 2014


Esteban,

Mind that you can combine these ajax calls in the following way:

html form: [
"...snipped code"
 html button
	bePush;
        onClick:  (html jQuery ajax
                  serializeForm;
                  json: [:json | json object: [ ] ];
                 onSuccess: 'console.log(arguments[0])');
   with: 'Filter!'
]

cheers
Johan

On 03 Mar 2014, at 07:21, Johan Brichau <johan at inceptive.be> wrote:

> 
> On 03 Mar 2014, at 02:09, Esteban A. Maringolo <emaringolo at gmail.com> wrote:
> 
>> Any suggestion?
> 
> That's because the button is triggering a submit. Change it to a push button as follows:
> 
> html form: [
> "...snipped code"
> html button
>   onClick:  (html jQuery ajax
>                  serializeForm;
>                  onComplete: (
>                    html jQuery getJson
>                      json: [:json | self renderJsonResponseOn: json ];
>                      onSuccess: 'console.log(arguments[0])'));
>   with: 'Filter!'
> ]
> 
>> ps: Is there a way to generate pretty-printed JS and HTML source?
> 
> afaik, you have to use the browser development tools for that: 
> 
> https://plus.google.com/+AddyOsmani/posts/Q7t2U51G7YR
> 
> cheers
> Johan



More information about the seaside mailing list