[Seaside] Live update (XMLHttpRequest) to update 3 dependent lists (<select>)

John Pierce john.raymond.pierce at gmail.com
Tue Feb 8 14:12:49 CET 2005


Hi all,

Yes -- this is a problem that I had to address in the LiveWeb package
I've been working on.  Basically, some browsers (FireFox) do, in fact,
run new script blocks that get inserted into the document. 
Unfortunately, IE does not.

So the work around is to run the javascript eval() function in your
own handler of the results that come back from live update.  I can
find some code examples tonight if you are interested, but the short
story is that you have to parse out the javascript that is inside the
<script> blocks and then run eval on the resultant code.

You may find that javascript regex works to get the contents of the
script block, but I found javascript regex too be quite resource
intensive so I ended up rolling my own parsing function.

Let me know if you want some code snippets.  My live web package is on
my squeak.saltypickle.com squeaksource server if you are interested.

Regards,

John


On Tue, 8 Feb 2005 13:54:41 +0100 (CET), radoslav hodnicak <rh at 4096.sk> wrote:
> On Tue, 8 Feb 2005, Yar Hwee Boon wrote:
> 
> > properly. But if I change the country followed by the state, the street
> > name list does not change. The reason is that after the state list is
> > refreshed, the onchange handler is not set, ie. the <script> contents
> > is not run. Has anyone done something this, or have any idea how to
> > solve this? thanks.
> 
> Yeah I ran into this problem when I wanted to live-update the component
> that triggered the live update... however I haven't found any obvious way
> to update the handler script. Maybe some DOM/JS expert will chime in...
> 
> rado
> 
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
> 


-- 
Only the mediocre are always at their best. -- Jean Giraudoux


More information about the Seaside mailing list