[Seaside] Generating javascript again ...

Michel Bany m.bany at wanadoo.fr
Thu Jun 3 07:58:40 CEST 2004


Julian Fitzell a écrit :

> Hm... I'd expect that code to be executed by an onload handler so it 
> would get executed after all the page is rendered.
>
> And yes, your assessment of the quoting problem is correct.  We 
> changed things so that entities were encoded by default and this is 
> obviously an exception case that was missed.  We'd happily take a 
> patch that fixes it.
>
> Julian
>
> Romain Robbes wrote:
>
>> Note that as said on our previous mail, currently scripts are broken 
>> since quotes (") are converted to " .
>> To get around that we had to implement the #script: method :
>>
>> script: script
>>     self attributeAt: 'language' put: 'text/javascript'.
>>     self openTag: 'script'.
>>     self html: script.
>>     self closeTag: 'script'.
>>
Since the 'language' attribute is XHTML-deprecated for the script tag, I 
was using the following instead:
script: aBlock
    self attributes at: 'type' put: 'text/javascript'.
    self  tag: 'script' do: [self html: aBlock]

For the same reason I am also using the following for the header script 
tags :
scriptWithUrl: urlString
    self attributes
        at: 'type' put: 'text/javascript';
        at: 'src' put: urlString.
    self headTag: 'script'.

Michel.



More information about the Seaside mailing list