[Seaside] Keep-alive timer for Seaside app

Tony Fleig tony.fleig at gmail.com
Thu Jan 6 19:52:09 UTC 2011


Ah. I understand. Thank you for the explanation.

What confused me was that the interval callback was working in every case.

And I didn't realize that a failure in a load script would prevent
execution of Javascript that (from my viewpoint) is attached to events
and unrelated to the load script. Inspection of the generated code
makes it clear that Seaside is packaging it all up together, using
bind() to assign the event handlers, hence its susceptibility to
errors early in the Javascript code. Something to remember.

Safari's dev tools did show a "parse error" and provided the line on
which it occurred. Unfortunately, the line was the entire 5000+
characters of Seaside-generated Javascript and it was not clear to me
where in that mess the problem was happening. Still, I suppose I
should have tracked that down since it would have ultimately led to
the solution. I don't suppose there is an option I don't know about to
have Seaside generate formatted Javascript? How do other people deal
with this situation?

I'm a little disappointed that there wasn't a more useful indication
of what the error actually was and where it occurred, like a walkback
in the Smalltalk environment or something.

I have to say that I like the way solutions to problems in Smalltalk
often seem to result is less code rather than more.

Regards,
TF



On Thu, Jan 6, 2011 at 10:36 AM, Johan Brichau <johan at inceptive.be> wrote:
>
> On 06 Jan 2011, at 17:53, Tony Fleig wrote:
>
>> | script cacheTimeout |
>>       cacheTimeout := self session application cache expiryPolicy
>> configuration at: #cacheTimeout.
>>       html document addLoadScript: (
>>               html script: (
>>                       html jQuery ajax
>>                               callback: [];
>>                               interval: (cacheTimeout - 60) seconds))
>>
>> The checkbox onChange script and callback never happen.
>>
>> I don't understand what is going on here. Somehow the load script is
>> interfering with ajax execution elsewhere on the page. Inspection of
>> the source code has revealed nothing obvious to me.
>
> The argument of addLoadScript should be a String or a JSScript.
> In the code above, it's the return value of the statement "html script: ... ", which is the WACanvas instance (in the html variable) itself.
>
> Inspection of the source code should have revealed that. Are you not using something like Firebug (or any other development tools in Chrome or Safari) at the client side?
>
> A crash of javascript on your page will prevent it from executing the other javascripts (onChange handlers) on your page.
>
> Try the following:
>
> | script cacheTimeout |
>        cacheTimeout := self session application cache expiryPolicy
> configuration at: #cacheTimeout.
>        html document addLoadScript: (
>                        html jQuery ajax
>                                callback: [];
>                                interval: (cacheTimeout - 60) seconds)_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list