How to make the page automatically refreshed once? No click on the button, etc.
- Well, here you have to try to keep the information about updating the page in cookies - AseN
- If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky ♦
|
2 answers
You can do the same with php cookie and
<meta http-equiv='refresh'; content='TIME; url=URL'>
|
Hey. You can try to do this with JavaScript and using cookies. Something like this should work:
<script language="JavaScript" type="text/javascript"> function setCookie (name, value) { document.cookie = name + "=" + escape(value); } function getCookie(name) { var cookie = " " + document.cookie; var search = " " + name + "="; var setStr = null; var offset = 0; var end = 0; if (cookie.length > 0) { offset = cookie.indexOf(search); if (offset != -1) { offset += search.length; end = cookie.indexOf(";", offset) if (end == -1) { end = cookie.length; } setStr = unescape(cookie.substring(offset, end)); } } return(setStr); } var cookie = getCookie('reload'); if (cookie == null) { setCookie('reload', 0); } var reload = getCookie('reload'); if (reload == 0) { setCookie('reload', 1); // обновляем страницу window.location.reload(); } </script>
This is how it works.
- onealert will never be shown - karmadro4
|