On Thu, Dec 9, 2010 at 06:46, Nandan Bagchee <[email protected]> wrote:
>
> I guess send-script works differently from what I thought (was there a
> change from weblocks 0.8.2 to current weblocks-dev?). The code above looks
> like something parenscript would do...
> Try using ps:ps instead of ps:ps* (in your original code)
> * (ps:ps* (defun bar () (+ 2 1)))
> => "bar;"
> whereas
> * (ps:ps (defun bar () (+ 2 1)))
> =>
> "function bar() {
> return 2 + 1;
> };"
>
(defun naslovna-stranica ()
(format nil "Sad smo u naslovnoj stranici")
(weblocks:with-javascript-to-string
(ps:ps (defun bar () (+ 2 1))))) ;:after-load))
This creates the following html code:
<div class='widget string-widget' id='dom17'><p><script
type='text/javascript'>
// <![CDATA[
function bar() {
return 2 + 1;
};
// ]]>
</script></p></div>
Which is not quite what I had in mind, because it is rendered as the
part of the web content (text) displayed to the user. Also, the format
string is not shown. I don't understand why. The lack of documentation
is a bit frustrating, especially since I can find source on the net
that apparently demonstrates the ability to insert javascript code
where needed, not as text but as code that the browser will interpret.
Is there really no other way but to define a widget that will do this?
--
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en.