I have slideshow page comes from view
我有幻灯片页面来自视图
Page URL: http://localhost.com/entertainment/word
页面URL:http://localhost.com/entertainment/word
In this page i have slideshow that have prev and next button..
在这个页面我有幻灯片显示有上一个和下一个按钮..
When i press next button, it calls views ajax and goes to next slide by append ?page=2 then URL becomes "http://localhost.com/entertainment/word?page=2" without page refresh .
当我按下一个按钮时,它会调用视图ajax并通过追加到页面= 2进入下一张幻灯片,然后在没有页面刷新的情况下,URL变为“http://localhost.com/entertainment/word?page=2”。
After every ajax call i need to get the appended value like page="2" in custom module.
每次ajax调用后,我需要在自定义模块中获取附加值,如page =“2”。
3 个解决方案
#1
0
Since it's ajax call, I guess you should get the page value using JS.
因为它是ajax调用,我想你应该使用JS获取页面值。
document.URL.split("page=")[1]
#2
0
If you need to retrieve the active page within a module (server-side), you can make use of the pager_find_page
function.
如果需要在模块(服务器端)中检索活动页面,则可以使用pager_find_page函数。
This will return an integer of the active page based on the page
querystring parameter.
这将根据页面querystring参数返回活动页面的整数。
- http://localhost.com/entertainment/word would return 0
- http://localhost.com/entertainment/word?page=2 would return 2
- etc ...
http://localhost.com/entertainment/word将返回0
http://localhost.com/entertainment/word?page=2将返回2
#3
0
I have done with Sessions.
我已经完成了Sessions。
Got nid in the view page and assigned to seesion variable.
在视图页面中找到了nid并分配给了seesion变量。
get that session variable in .module file.
在.module文件中获取该会话变量。
#1
0
Since it's ajax call, I guess you should get the page value using JS.
因为它是ajax调用,我想你应该使用JS获取页面值。
document.URL.split("page=")[1]
#2
0
If you need to retrieve the active page within a module (server-side), you can make use of the pager_find_page
function.
如果需要在模块(服务器端)中检索活动页面,则可以使用pager_find_page函数。
This will return an integer of the active page based on the page
querystring parameter.
这将根据页面querystring参数返回活动页面的整数。
- http://localhost.com/entertainment/word would return 0
- http://localhost.com/entertainment/word?page=2 would return 2
- etc ...
http://localhost.com/entertainment/word将返回0
http://localhost.com/entertainment/word?page=2将返回2
#3
0
I have done with Sessions.
我已经完成了Sessions。
Got nid in the view page and assigned to seesion variable.
在视图页面中找到了nid并分配给了seesion变量。
get that session variable in .module file.
在.module文件中获取该会话变量。