[Seaside] [FIX] liverUpdate JavaScript problem

Avi Bryant avi.bryant at gmail.com
Fri Jan 7 18:56:11 CET 2005


On Fri, 7 Jan 2005 12:47:51 -0500, Pennell, David <DPennell at quallaby.com> wrote

> Changing the following line in WAStandardScripts>>liveUpdate:
>     var regex = /<(\w+).*?id="(\w+)".*?>((.|\n)*)<\/\1>/;
> to:
>     var regex = /<(\w+).*?id="(\w+)".*?>((.|\n|\r)*)<\/\1>/;
> 
> seems to do the trick.

Thanks.

> Also - this regex matches a lot more than I expected.
> The total match is the entire <html>...</html> range. Results[3] is from
> the body of the first tag with an id up to and including the </html>
> close tag.  The browser just stops when it finds an appropriate closing
> tag.

That's a lot more than I expected too.  The intent was to go from the
first open tag with an id to the last close tag for the same element. 
I think the problem is in the ".*?id" - it should be something like
[^>]*?id so that it can't cross tags.

Avi


More information about the Seaside mailing list