[cl-who-devel] onclick
Andy Peterson
andy.arvid at gmail.com
Thu Apr 12 15:55:13 UTC 2012
On Thu, Apr 12, 2012 at 10:47 AM, Stas Boukarev <stassats at gmail.com> wrote:
>
> Stas Boukarev <stassats at gmail.com> writes:
>
> > "Haris Bogdanovich" <fbogdanovic at xnet.hr> writes:
> >
> >> I installed all the libraries (cl-who, parenscript and hunchentoot) properlly
> >> with the latest quicklisp but I can't still autocomplete :onclick.
> > You shouldn't be able to autocomplete :onclick. Autocomplete in slime
> > works only for interned symbols, once you compile the code it will be
> > interned and you would see it in the autocompletion. cl-who doesn't
> > intern symbols into keyword for it to work.
> >
> >> If I just write it the program stilll doesn't work.
> >> What could be the problem ?
> > :onclick should come before the body of <p>, so,
> >
> > (with-html-output-to-string (*standard-output* nil)
> > (:html
> > (:head)
> > (:body
> > (:p :onclick "alert(\"Hello\")"
> > "click me"))))
> >
> > I don't know how parenscript is supposed to work, but (ps (alert
> > "hello")) returns "alert('hello');", and cl-who uses #\' to quote
> > strings, so it becomes 'alert('hello');', which obviously doesn't work.
>
> (setf ps:*js-string-delimiter* #\") for
>
> (:p :onclick (ps (alert "hello")) "click me")
>
> to work.
>
> --
> With best regards, Stas.
>
>From the parenscript manual:
(PS-INLINE form &optional *JS-STRING-DELIMITER*)
(PS-INLINE* form &optional *JS-STRING-DELIMITER*)
PS-INLINE and PS-INLINE* take a single Parenscript form and output a
string starting with javascript: that can be used in HTML node
attributes. As well, they provide an argument to bind the value of
*JS-STRING-DELIMITER* to control the value of the JavaScript string
escape character to be compatible with whatever the HTML generation
mechanism is used (for example, if HTML strings are delimited using
#\', using #\" will avoid conflicts without requiring the output
JavaScript code to be escaped). By default the value is taken from
*JS-INLINE-STRING-DELIMITER*.
comment: the default value for *JS-INLINE-STRING-DELIMITER* is #\"
More information about the Cl-who-devel
mailing list