我正在使用Seaside(Squeak 4.2中的2.8),我通常会像这样更新:
html div onClick: ((html jQuery: '#asdf') load html: [:h|h text: 'qwer']) ; with: 'asdf'.
但这一次,我必须定期更新div.
我在另一个项目中使用了PT的periodicalEvaluator,但是在这个我不能,我必须坚持使用JQ.
我尝试使用JQInstance的延迟:millis在我能想到的所有组合中:
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
出于某种原因,更新是瞬时的,而不是在我需要的1000毫秒之后.
解决方法
看看JQuery功能测试套件附带的示例:
JQRepeatingFunctionalTest>>#renderContentOn: html html paragraph script: (html jQuery this load html: [ :r | self renderTimeOn: r ]; interval: 1 seconds); with: [ self renderTimeOn: html ]
该示例运行here.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。