jQuery:每次将不同的数据传递给periodicalupdater?

发布于 2024-08-30 01:09:35 字数 372 浏览 1 评论 0原文

在我的设置中,将获取所有条目的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一片旧的回忆 2024-09-06 01:09:35

啊,抱歉。

我刚刚意识到我可以为数据字段添加函数调用,以使其重新获取变量。

谢谢大家:)

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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文