[Bese-devel] Re: javascript suppression?

Marco Baringer mb at bese.it
Fri Jul 14 09:45:17 UTC 2006


hbabcockos1 at mac.com writes:

> Hello,
>
> If I define a component as:
>
> (defcomponent flashcard (simple-window-component)
>   ((content :accessor content
> 		 :initform nil))
>   (:default-initargs
>     :title "Test"
>     :content-type "text/html; charset=utf-8;"
>     :javascript nil))
>
> When I look at the generated html I see that it adds both "dojo.js"
> and "per-application.js". I thought that setting ":javascript nil"
> might suppress javascript, but apparently it does not. Is there a way
> to specify that you want a "pure" HTML app? I'm using "<ucw:simple- 
> form" for my forms so I don't think I need javascript.

don't use simple-window-component.

since it's your own custom component and some generic be-all-end-all
it'll be much simpler for you to do this:

(defcomponent flashcard ()
  ((content :accessor content :initform nil)))

(defmethod render ((flashcard flashcard))
  (<:as-is "<!DOCTYPE html PUBLIC \"" (window-component.doctype window) "\">" #\Newline)
  (<:html :prologue nil
    (<:head
      (<:meta :http-equiv "Content-Type" :content (window-component.content-type window))
      (<:title "Test"))
    (<:body
      (render (content flashcard)))))

simpler, shorter, and clearer.

-- 
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen




More information about the bese-devel mailing list