forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <>
Subject Re: javascript in dispatcher theme
Date Mon, 29 Jan 2007 11:43:41 GMT
Found the problem.

It turns out that Firefox and IE do not like empty <script>  
elements... As soon as I changed the tag from the empty style seen  
below to a standard element with both an open and a close element,  
everything looks fine again, both in MS IE and in Firefox.

The dispatcher / skin difference is probably caused by the dispatcher  
producing xml (ie xhtml), whereas the non-dispatcher version produced  
plain html. Or rather, Firefox and MS IE do not correctly handle  
xhtml in all its aspects, including empty elements.

Is there a way to tell dispatcher to serialize the final byte stream  
as html, not xhtml? Is it desirable?


Den 26. jan. 2007 kl. 18.59 skrev Sjur Moshagen:

> Hello again,
> A completely unrelated question:
> How to I include a reference to a javascript in a dispatcher theme?  
> I have a file-specific theme based on pelt.fv in which I want to  
> output a script element in the resulting html file, containing a  
> reference to a javascript file.
> I couldn't find a proper contract for the job, so I took a  
> shortcut, by just adding it to what seemed like another, similar  
> construct:
> ...
>     <forrest:contract name="siteinfo-meta" dataURI="lm:// 
>       <forrest:property name="custom">
>          <meta http-equiv="content-type" content="text/html;  
> charset=UTF-8"/>
>          <script language="javascript" src="themes/risten.js"  
> type="text/javascript"/> <== this line
>       </forrest:property>
>       <forrest:property name="theme" value="pelt"/>
>     </forrest:contract>
> ...
> Now, this seemed to work perfect, at least by first glance (ie in  
> Safari). But when I tested the result in Firefox, the whole page  
> was completely screwed up:
> - all the content within the div#header was gone, logos, tabs,  
> search box and everything
> - Firefox reported the same content to be part of the html/head  
> element, which it was not
> The same could be observed in IE 6, whereas Opera behaved as nicely  
> as Safari.
> Just to be sure, I would like to either get confirmation that the  
> above should be ok, or instructions on how to include a script  
> element in a proper way.
> Thanks a lot for your attention,
> Sjur

View raw message