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.search
yourself or using existing code for it.
精彩评论