jQuery:每次将不同的数据传递给periodicalupdater?
在我的设置中,将获取所有条目的 id(例如分配给变量 ids=2,5,7,9,11
)并传递给 periodicalupdater 以发送到 php 脚本。问题是,当通过 ajax 添加新条目时,id 列表会随着时间而变化。如何才能使更新后的条目 ID 列表在每次执行时传递给 periodicalupdater?根据我的观察,第一次运行时,数据被“缓存”或捕获并一次又一次地重用,并且在每次“执行”之前不会重新获取变量(ids
)。
或者,如果不能的话,是否有其他插件或代码可以做到这一点?我只是想通过 ajax 将条目 id 列表发送到服务器脚本,服务器脚本将每隔一段时间返回一个 xml 文件进行处理(仅当有任何更改时)。
感谢您的帮助! :)
On my setup, the ids of all entries will be fetched (e.g. assigned to variable ids=2,5,7,9,11
) and passed to periodicalupdater to send to a php script. The problem is that the list of ids change over time, when new entries are added via ajax. How can I make it such that the updated id list of entries will be passed to periodicalupdater at each execution? From my observations, the first time it runs, the data is "cached" or captured and reused again and again and doesn't refetch the variable (ids
) before each "execution".
Alternatively, is there another plugin or code that can do this if this can't? I'm just looking to send the list of entry ids to a server script via ajax, which will in turn return a xml file for processing (only if there's any changes) at intervals.
Thanks for your help! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,抱歉。
我刚刚意识到我可以为数据字段添加函数调用,以使其重新获取变量。
谢谢大家:)
Ah my apologies.
I just realised I can add a function call for the data field instead to make it refetch the variable.
Thanks all :)