[Seaside] Seaside: Jquery cascade messages

Johan Brichau johan at inceptive.be
Wed Nov 3 19:26:13 UTC 2010


Hi Bart,

The #prependTo: message is sent to 's' in the cascade. I think you mean this:

html jQuery ajax script: [ :s | s << ((((s jQuery html:  [ :r | self renderTweetsOn: r ]) hide prependTo: (s jQuery id: #tweets)) slideDown: 'slow')];

also watch out with the following pattern:

s << html jQuery keyword: #something

I have gotten burned by "forgetting" that binary messages are evaluated before keyword messages. The correct form is:

s << (html jQuery keyword: #something)

The strange thing is that it often works without the parentheses, but might go completely wrong when you concatenate the scripts (been there, done that :-).

cheers
Johan


On 03 Nov 2010, at 20:09, Bart Gauquie wrote:

> If I update this to: 
> 	((html jQuery ajax script: [ :s | s << (s jQuery html:  [ :r | self renderTweetsOn: r ]) hide; prependTo: (s jQuery id: #tweets)]; slideDown: 'slow';
> 
> 
> it fails with error:
> 
> that JSScript>>prependTo: does not exist.
> meaning that the hide message send returned a JSScript object instead of a JQueryInstance (which is what I expected to happen).
> 
> Any way to solve this?




More information about the seaside mailing list