Seaside的定期JQuery更新

ben*_*ben 5 jquery smalltalk seaside

我正在使用Seaside(Squeak 4.2中的2.8),我通常会像这样更新:

html div 
    onClick: ((html jQuery: '#asdf') load html: [:h|h text: 'qwer'])
    ; with: 'asdf'.
Run Code Online (Sandbox Code Playgroud)

但这一次,我必须定期更新div.

periodicalEvaluator在另一个项目中使用过PT ,但是在这个项目中我不能,我必须坚持使用JQ.

我尝试delay:millis在我能想到的所有组合中使用JQInstance :

onClick: (((html jQuery id: 'chattertext') delay: 1000; yourself) load html: [:h| self renderTextOn: h])
; onClick: (((html jQuery id: 'chattertext') delay: 1000) load html: [:h| self renderTextOn: h])
; onClick: (((html jQuery id: 'chattertext') delay: 1000; load) html: [:h| self renderTextOn: h])
and others
Run Code Online (Sandbox Code Playgroud)

出于某种原因,更新是瞬时的,而不是在我需要的1000毫秒之后.

Luk*_*gli 4

看一下 JQuery 功能测试套件附带的示例:

JQRepeatingFunctionalTest>>#renderContentOn: html
  html paragraph
    script: (html jQuery this load
      html: [ :r | self renderTimeOn: r ];
      interval: 1 seconds); 
  with: [ self renderTimeOn: html ]
Run Code Online (Sandbox Code Playgroud)

该示例正在此处运行。