Content preview: On Thu, Apr 12, 2012 at 10:47 AM, Stas Boukarev <***@gmail.com>
wrote: > > Stas Boukarev <***@gmail.com> writes: > > > "Haris Bogdanovich"
<***@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.
Post by Haris BogdanovichIf 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. > [...]
Content analysis details: (-0.7 points, 5.0 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.217.179 listed in list.dnswl.org]
0.0 SINGLE_HEADER_2K A single header contains 2K-3K characters
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
(andy.arvid[at]gmail.com)
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.who.general/302>
Post by Haris BogdanovichI 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.
Post by Haris BogdanovichIf 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.
(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 #\"