Callback timer in Pharo smalltalk + Seaside

I just ported the Dolphin Smalltalk + Seaside app to the latest Pharo Smalltalk 4.0 and Seaside 3.1. In it, I need a callback every second from the client (browser) to the server (Pharo) to update the view.

I had this piece of code to automatically click the refresh button every second. But after the port it does not work anymore:

html script: (
    ( html jQuery: '#updateButton' ) 
        call: 'click';
        interval: 1000 ).

I was looking for a network for other (more elegant?) Solutions, but I can't get them to work. Can someone give me a hint on how to proceed?

This is the JavaScript code that is generated by the code above and which was used to work in Dolphin + Seaside:

<script type="text/javascript">
/*
<![CDATA[/setInterval(function(){$("#updateButton").cl‌​ick()},2000)/]]>
*/</script> 
+4
source share
1

, id #updateButton? , script, xx .

script 10 . , , , , :

html script: (
    ((html jQuery: 'body') load
        html: [ :innerHtml | self renderOn: innerHtml ]) 
            interval: 10000)
+5

Source: https://habr.com/ru/post/1617898/


All Articles