[Seaside] jQuery: (or JQueryClass>>with:) vs. id:
Sven Van Caekenberghe
sven at beta9.be
Sun Jun 6 10:05:23 UTC 2010
Lukas,
It makes sense to follow the original Javascript jQuery API.
I also overlooked the fact that the Strings in #jQuery: and #with: already go to #expression:
Thanks for the reply.
Sven
On 05 Jun 2010, at 22:10, Lukas Renggli wrote:
> The jQuery constructor on the Javascript side takes all kinds of
> different arguments that make different things to happen.
>
> http://api.jquery.com/jQuery/
>
> #jQuery: and #with: try to emulate that to some extent. If you want to
> be explicit you should use the more specific constructor methods.
>
> Lukas
>
> On 5 June 2010 21:27, Sven Van Caekenberghe <sven at beta9.be> wrote:
>> I got really confused today trying to use the JQuery library to do some simple AJAX update. I was writing my own code based on JQAjaxFunctionalTest. BTW, these self-documenting functional tests are really incredibly awesome.
>>
>> Instead of the actual example:
>>
>> html code id: #logger; with: DateAndTime now.
>> html submitButton
>> onClick: (html jQuery ajax
>> script: [ :s | s << (s jQuery: #logger) html: DateAndTime now ]);
>> with: 'Replace'
>>
>> I wrote:
>>
>> |id|
>> id := html nextId.
>> html code id: id; with: DateAndTime now.
>> html submitButton
>> onClick: (html jQuery ajax
>> script: [ :s | s << (s jQuery: id) html: DateAndTime now ]);
>> with: 'Replace'
>>
>> And it took me quite some time to figure out that it had to be:
>>
>> |id|
>> id := html nextId.
>> html code id: id; with: DateAndTime now.
>> html submitButton
>> onClick: (html jQuery ajax
>> script: [ :s | s << (s jQuery id: id) html: DateAndTime now ]);
>> with: 'Replace'
>>
>> Looking at the implementation of jQuery: and JQueryClass>>with: my first impression is that this could be added, but I probably don't see all the consequences. From an external API standpoint, it would be logical and nice to have.
>>
>> Sven
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list