5.4.11 The Ajax.PeriodicalUpdater class

优质
小牛编辑
128浏览
2023-12-01

继承自Ajax.Base

这个类重复生成并使用Ajax.Updater 对象来刷新页面中的一个元素。或者执行Ajax.Updater 可以执行的其它任务。更多信息参照Ajax.Updater 参考。

PropertyTypeKindDescription
containerObjectinstance这个值将直接传入Ajax.Updater的构造方法。
urlStringinstance这个值将直接传入Ajax.Updater的构造方法。
frequencyNumberinstance两次刷新之间的间隔(不是频率) ,以秒为单位。默认2秒。This 当调用Ajax.Updater 对象的时候,这个数将和当前的decay 相乘。
decayNumberinstance重负执行任务的时候保持的衰败水平。
updaterAjax.Updaterinstance最后一次使用的Ajax.Updater 对象
timerObjectinstance通知对象该下一次更新时用到的JavaScript 计时器。
MethodKindArgumentsDescription
[ctor](container, url, options)constructorcontainer:this can be the id of an element, the element object itself, or an object with two properties - object.success element (or id) that will be used when the AJAX call succeeds, and object.failure element (or id) that will be used otherwise. url: the url to be fetched, options: AJAX options创建一个用给定的选项请求给定的url的一个实例。
start()instance(none)这个方法通常不会被外部调用。对象为了开始周期性执行任务的时候调用的方法。
stop()instance(none)使对象停止执行周期任务。停止后,如果有onComplete选项,那么引发callback。
updateComplete()instance(none)这个方法通常不会被外部调用。被当前的Ajax.Updater 使用,当一次请求结束的时候,它被用作计划下一次请求。
onTimerEvent()instance(none)这个方法通常不会被外部调用。当到下一次更新时被内部调用。