网络编程
位置:首页>> 网络编程>> JavaScript>> prototype.js1.4版开发者手册(12)

prototype.js1.4版开发者手册(12)

作者:THIN 来源:cnblogs 发布时间:2007-09-30 14:09:00 

标签:prototype,手册


The Ajax.Updater class

继承自 Ajax.Request

当请求的url返回一段HTML而你想把它直接放置到页面中一个特定的元素的时候被用到。 如果url的返回<script> 的块并且想在接收到时就执行它的时候也可以使用该对象。含有脚本的时候使用 evalScripts 选项。


PropertyTypeKindDescription
containersObjectinstance这个对象包含两个属性:AJAX请求成功执行的时候用到 containers.success , 否则的话用到 containers.failure



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的一个实例。
updateContent()
(none)这个方法通常不会被外部调用。 当响应到达的时候,被这个对象自己调用。 它会用HTML更新适当的元素或者调用在 insertion 选项中传入的方法-这个方法将被传入两个参数, 被更新的元素和响应文本。



The Ajax.PeriodicalUpdater class


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


PropertyTypeKindDescription
containerObject
这个值将直接传入Ajax.Updater的构造方法。
urlStringinstance这个值将直接传入Ajax.Updater的构造方法。
frequencyNumberinstance两次刷新之间的间隔 (不是频率) ,以秒为单位。 默认2秒。 This 当调用 Ajax.Updater 对象的时候,这个数将和当前的 decay 相乘。
decay
instance重负执行任务的时候保持的衰败水平。
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, optio


0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com