Using script tag with updater.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using script tag with updater.

Igor Stasenko
I want to add a <script> tag into updateable area.

Using this sample:

html anchor
        onClick: (html updater  id: 'myId';
                callback: [ :render | render script: [ 'alert("here");' ].
         ].


I want to add <script> tag into updateable area, but it silently
stripped. Any HTML tags are updated ok, but not <script>.

Can someone tell me, is it a feature or issue?
And how i can load a script _and_ html via updater and then eval these scripts.
I also tried to use evalScripts: true, but it fails with javascript errors .

Regards,
sig
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Using script tag with updater.

Lukas Renggli
> html anchor
>         onClick: (html updater  id: 'myId';
>                 callback: [ :render | render script: [ 'alert("here");' ].
>          ].
>
>
> I want to add <script> tag into updateable area, but it silently
> stripped. Any HTML tags are updated ok, but not <script>.

This is a FAQ: The JavaScript code of script.aculo.us strips them by
default. The latest version of Scriptaculous automatically sets the
property #evalScripts: to true, if you are not in the alpha branch of
Seaside you have to do that yourself.

> I also tried to use evalScripts: true, but it fails with javascript errors .

What kinds of errors? FireBug?

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Using script tag with updater.

Igor Stasenko
I tried to use script: 'alert("here");'
and it works.
It seems it don't expect a block there.

On 21/05/07, Lukas Renggli <[hidden email]> wrote:

> > html anchor
> >         onClick: (html updater  id: 'myId';
> >                 callback: [ :render | render script: [ 'alert("here");' ].
> >          ].
> >
> >
> > I want to add <script> tag into updateable area, but it silently
> > stripped. Any HTML tags are updated ok, but not <script>.
>
> This is a FAQ: The JavaScript code of script.aculo.us strips them by
> default. The latest version of Scriptaculous automatically sets the
> property #evalScripts: to true, if you are not in the alpha branch of
> Seaside you have to do that yourself.
>
> > I also tried to use evalScripts: true, but it fails with javascript errors .
>
> What kinds of errors? FireBug?
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside