Another question: the tutorial has
:onclick (ps (previous-image) (return false))
but the reference says
RETURN can only be used to return a value from a function
and indeed, when trying to use return in a
(:a :href "..." :onclick (ps (my-func) (return false)))
I get a warning
Returning from unknown block nilBlock
What's the typical way for PS use in an onclick handler?
Thank you for your patience!
Regards,
Phil
What's the typical way for PS use in an onclick handler?
The code you used will produce working JavaScript, but the answer to the particular question about onclick handlers is "don't." It's better to set up event handling in JavaScript: http://stackoverflow.com/questions/5871640/why-is-using-onclick-in-html-a-ba...
I haven't tried https://github.com/petermichaux/evento but Peter Michaux's previous JS event libraries have been nice.
If you want to specify onclick handlers in HTML, having onclick="foo();" and defining foo later is the neatest way to do it.
Vladimir
parenscript-devel@common-lisp.net