From: jumperjack42
Subject: parenscript with CL-WHO and hunchentoot
Date: 
Message-ID: <1168279333.214220.228490@42g2000cwt.googlegroups.com>
I tried to use parenscript today to generate some some javascript
embedded in html. I am using CL-WHO library to generate html and try to
embed javascript using parenscript. The code is below. When this runs
it generates javascript that firefox does not like. Can someone look at
the js-inline call and let me know if I am doing something wrong.

(defun trial-page()
  (with-html-output-to-string(*standard-output* nil :prologue t)
    (:html (:head (:title "This a trial"))
           (:body (:h1 "Combine Parenscript with cl-who")
                  (:p "Please click the link below."
                      ((:a :href "#" :onclick (js-inline(alert "Hello
World")))
                       "Click Here"))))))

From: sross
Subject: Re: parenscript with CL-WHO and hunchentoot
Date: 
Message-ID: <1168428333.423671.249580@p59g2000hsd.googlegroups.com>
jumperjack42 wrote:
> I tried to use parenscript today to generate some some javascript
> embedded in html. I am using CL-WHO library to generate html and try to
> embed javascript using parenscript. The code is below. When this runs
> it generates javascript that firefox does not like. Can someone look at
> the js-inline call and let me know if I am doing something wrong.
>

The call is fine but cl-who and parenscript conflict with the use
of the #\' character. Fortunately cl-who allows you to change
what character is used to quote attributes so get the latest
version of cl-who (or at least 0.6.0) and rebind
cl-who:*attribute-quote-char* to #\".

Cheers,
 Sean.
From: jumperjack42
Subject: Re: parenscript with CL-WHO and hunchentoot
Date: 
Message-ID: <1168486755.400868.103560@p59g2000hsd.googlegroups.com>
thanks alot. it worked and saved me alot of heart ache. How do you
debug problems like this. Are there any tricks or is it "Try Try....."
=> "Success"
On Jan 10, 3:25 am, "sross" <······@gmail.com> wrote:
> jumperjack42 wrote:
> > I tried to use parenscript today to generate some some javascript
> > embedded in html. I am using CL-WHO library to generate html and try to
> > embed javascript using parenscript. The code is below. When this runs
> > it generates javascript that firefox does not like. Can someone look at
> > the js-inline call and let me know if I am doing something wrong.The call is fine but cl-who and parenscript conflict with the use
> of the #\' character. Fortunately cl-who allows you to change
> what character is used to quote attributes so get the latest
> version of cl-who (or at least 0.6.0) and rebind
> cl-who:*attribute-quote-char* to #\".
> 
> Cheers,
>  Sean.
From: Toby Allsopp
Subject: Re: parenscript with CL-WHO and hunchentoot
Date: 
Message-ID: <87wt3uf0w5.fsf@candyboy.here>
"sross" <······@gmail.com> writes:

> jumperjack42 wrote:
>> I tried to use parenscript today to generate some some javascript
>> embedded in html. I am using CL-WHO library to generate html and try to
>> embed javascript using parenscript. The code is below. When this runs
>> it generates javascript that firefox does not like. Can someone look at
>> the js-inline call and let me know if I am doing something wrong.
>
> The call is fine but cl-who and parenscript conflict with the use
> of the #\' character. Fortunately cl-who allows you to change
> what character is used to quote attributes so get the latest
> version of cl-who (or at least 0.6.0) and rebind
> cl-who:*attribute-quote-char* to #\".

That's all well and good until your JavaScript contains a #\"
character.  I think what you really want is #'escape-string
(http://weitz.de/cl-who/#escape-string).

Regards,
Toby.