[BUG?] $().replace() consumes loadScripts

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

[BUG?] $().replace() consumes loadScripts

Udo Schneider
All,

I'm not quite sure whether this is a bug or not ...

Seaside2.8a1-lr.572 and Scriptaculous-lr.242 with Damien's
sq3.10.2-7179web08.12.1 image:

Use the following render method:
renderContentOn: html
        self session addLoadScript: 'alert(''You should see this when the page
has loaded!'');'.
        html span id: 'replaceMe';
                 with: 'Replace me!'.
        html break.
        html anchor onClick: (html element id: 'replaceMe';
                         replace: 'Replaced!!');
                 with: 'Replace it'

When loaded one would expect the span and anchor to be shown (which is
the case). In addition one would expect an alert once the page is loaded
(which is not the case).

By inspecting the onclick property of the anchor one can see that it
consits of the text "Replaced!!" plus the loadscripts (including
surounding script tags)!!! The loadScript section at the end of the
document is empty.

So it seems that the loadscripts are appended to the replace expression
- I have no idea why. Clicking on the anchor changes the text and
executes the load scripts ... quite "funny".

If you comment out the #addLoadScript part or the #replace: statement
the remaining part works as expected.

I'm not quite sure what to get out of this ...

CU,

Udo
(... a bit confused)

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

Re: [BUG?] $().replace() consumes loadScripts

Lukas Renggli
This is a bug in Seaside 2.8. When starting new rendering process the
load-scripts mess up sometimes and end up at the wrong place. I fixed
that in Seaside 2.9 already a while ago and just now back-ported it to
Seaside 2.8. Load Scriptaculous-lr.245 and your example should work:

   Name: Scriptaculous-lr.245
   Author: lr
   Time: 28 December 2008, 7:58:04 pm
   UUID: ec30f5f2-6213-438d-bdd5-4e457d9a7caa
   Ancestors: Scriptaculous-pmm.244

   - remember the load scripts when starting a sub-render process

Sorry for the inconvenience.

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: [BUG?] $().replace() consumes loadScripts

Lukas Renggli
This is the original bug report, btw:
http://code.google.com/p/seaside/issues/detail?id=25

On Sun, Dec 28, 2008 at 8:02 PM, Lukas Renggli <[hidden email]> wrote:

> This is a bug in Seaside 2.8. When starting new rendering process the
> load-scripts mess up sometimes and end up at the wrong place. I fixed
> that in Seaside 2.9 already a while ago and just now back-ported it to
> Seaside 2.8. Load Scriptaculous-lr.245 and your example should work:
>
>   Name: Scriptaculous-lr.245
>   Author: lr
>   Time: 28 December 2008, 7:58:04 pm
>   UUID: ec30f5f2-6213-438d-bdd5-4e457d9a7caa
>   Ancestors: Scriptaculous-pmm.244
>
>   - remember the load scripts when starting a sub-render process
>
> Sorry for the inconvenience.
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>



--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside