AJAX页面和next / prev链接有问题 [英] Problem with AJAX page and next / prev links

查看:64
本文介绍了AJAX页面和next / prev链接有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一小段HTML:

I have a snippet of HTML here:

展开 | 选择 | Wrap | 行号

推荐答案

更改SQL获取下一个有效ID。您只需要传递当前ID,而无需在JavaScript中增加数字。
Change the SQL to get the next valid ID. You only need to pass the current ID and there''s no need to increment the number in JavaScript.


感谢您的回复。


我是新来的 - 如何将当前ID发送回调用页面上的javascript - 我无法解决这个问题......


例如,如果我只发送当前ID,那么在页面上的第一次运行中,例如,currentID = 252.


如果用户按下Next,我可以从运行SQL的脚本页面获取下一个有效ID,但我看不出如何发送下一个有效ID,例如3048,返回打开ajax代码的页面,以便下次用户按下''Next''时,新的当前ID已从252更改为3048.


再次感谢
Thanks for the reply.

I''m new to this - how can I send the current ID back to the calling page with the javascript on it - I can''t work that bit out...

For example, if I only send the current ID, then on the first run on the page, for example, the currentID = 252.

If the user presses Next, I can get the next valid ID from the script page running the SQL, but I can''t see how I would send that next valid ID, e.g. 3048, back to the page with the ajax code on, so that the next time the user presses ''Next'', the new, current ID has changed from 252 to 3048.

Thanks again


您从脚本页面返回了什么?您可以使用数据格式,例如JSON或XML,或者如果使用字符串,则使用唯一分隔符(一个字符或一组字符)来分隔输出和ID,然后拆分在此分隔符上返回的字符串以获取这两个部分。
What are you returning from the script page? You can use a data format, e.g. JSON or XML, or if using a string, use a unique delimiter (a character or set of characters) to separate the output and the ID, and then split the string returned on this delimiter to get the two parts.


这篇关于AJAX页面和next / prev链接有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆