On 24 oct, 20:51, jlw <[EMAIL PROTECTED]> wrote:
> Ok. So I've written a web application with GWT where the page is
> dynamically generated from XML within a servlet. When serialized out,
> it produces a script element such as:
>
> <script language="javascript" src="com.module.Test.nocache.js" />
>
> This causes the hosted mode browser to not execute the module.

And I guess not only the Hosted Mode, as this is not valid HTML (but
looks more like XHTML, which IE doesn't know what to do with). If
you're sending this fragment as text/html, you're wrong.
See also:
http://hixie.ch/advocacy/xhtml
http://hsivonen.iki.fi/xhtml-the-point/
http://hsivonen.iki.fi/doctype/#parsing (« As far as browsers are
concerned, XHTML served as text/html is just “tag soup with
croutons” (an extra slash here and there). »)

> As a workaround, I create the script element:
>
> <script language="javascript" src="com.module.Test.nocache.js">
> // placeholder
> </script>
>
> This keeps the XML serializer from reducing the script element down to
> an empty tag as in the first example.

Or you could use an HTML serializer...
(I've heard people using javax.xml.transform to benefit from the
XSLT's HTML serializer)

See also:
http://hsivonen.iki.fi/code/api/fi/iki/hsivonen/xml/HtmlSerializer.html


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to