[Seaside] Re: liveCallback and SUAutocompleter

Michel Bany michel.bany at gmail.com
Wed Nov 22 08:27:26 UTC 2006

>> but does within an attribute
>> value. JavaScript code only works in a <script> when the contents is
>> not encoded, but this turns the XHTML invalid if the contents is not
>> within a CDATA construct. The CDATA construct should not harm any
>> browser that does not understand it, so what is your aversion against
>> it except that you don't like it?
> CDATA is not part of HTML. It's part of XML and we serve as text/html
> which means it gets treated as HTML. It's just plain wrong.
> Second, it breaks as soon as somewhere in a script is ']]>' lets say
> for XML parsing or whatever. For the person this happens this will
> mean real pain. It's not a solution, it just appears to works in some
> cases.

See http://javascript.about.com/library/blxhtml.htm
This article seems to say that CDATA should be used in XHTML for
javascript. XHTML is what is targeted by Seaside anyway.
Also, I believe that the w3c html 4 spec mentions CDATA.

Finally, I found out that the mistake was also in SeasideAsync itself
which was not properly encoding the scripts produced by Scriptaculous.
So I changed SeasideAsync to enclose the scripts within a CDATA
without the comment constructs. The comment construct is not used
because SeasideAsync callbacks respond with a 100% well-formed
XML document (including the <?xml . . . ?> header) and the CDATA
cannot be parsed when it is polluted by the comment construct.

My initial tests indicate that Scriptaculous scripts can now be  
from within SeasideAsync callbacks. Who is going to try a SeasideAsync
live request from within a Scriptaculous callback ? How deep can we
nest the SeasideAsync and Scriptaculous callbacks ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20061122/c6bbdcac/attachment-0001.htm

More information about the Seaside mailing list