I'm still trying to get to understand how Javascript is wrapped in Seaside, say I have the following query:
(html jQuery: '#myId') hasClass: 'myClass'
How do I get a true or a false out of this? For example in my case I'd love to be able to do:
html anchor
onClick:
(((html jQuery: '#myId')
hasClass: 'myClass')
ifTrue: [doSomething]
ifFalse: [doSomethingElse]);
with: 'Magic Stuff!'
What's the seaside way of doing this?
Thanks!
Depends where you want to perform the decision on the client or on the server?
Decide and Perform Action on Client
You can use
where
aTrueExpression' and
aFalseExpression' are other (jQuery) JavaScript expressions.Decide and Perform Action on Server
You serialize the result of your expression into an AJAX callback and perform the action on the Smalltalk side: