开发者

auto refresh page

I need to refresh a web page on the time i get from the user. That's fine. But how i do make

that permanent. Say, the user selects 30secs, and makes i开发者_开发技巧t permanent, I need to refresh every

30 secs. I tried $_SESSION, ineffective. Pls don't suggest cookies.


if cookies disabled, try using localstorage instead...


You'll need to persist the user's selection in some manner.

Cookies, session variable server-side, URL query parameter, localstorage - these are all options.

URL query parameters and SLaks's suggestion of POSTing let you keep different settings for different tabs opened simultaneously, if that matters to you.

EDIT: by URL query parameter I mean redirection, using window.location, to something like http://example.com/foo?refresh=30 and later parsing window.location.searchyourself or using existing code for it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜