This article mainly introduces the example code of using Ajax technology to achieve flicker-free scheduled page refresh. It is very good and has the value of reference and learning ajax. Friends who are interested in ajax should read it together
In web development, we often need to refresh a page regularly:
1. To maintain the value ofsessionor check whether the value of session is empty. (For example, to prevent the same user from logging in repeatedly);
2. Real-time in-site text messages;
3. Regularly update page data, etc. However, when we search on the Internet, we will find that there are many ways to refresh the page regularly. The simplest is to add the following code between the
tags:in < Add code between head>
tags to achieve regular refresh. I have tested this code and it can achieve the effect
Description: The value of content represents the interval between page refreshes, in seconds.
The value of URL specifies the page to be refreshed
Another way is to useJavaScriptto refresh the page regularly
JavaScript to refresh the page regularly, I don’t have this code After testing
is added to the middle of the body, here is 0:10 for 10 seconds, you can customize
The above is small The editor introduces to you the example code of Ajax to achieve flicker-free scheduled page refresh. I hope it will be helpful to you! !
Related recommendations:
Solution to Ajax rollback refresh page problem
Ajax submission Form form page will still refresh j solution
The above is the detailed content of Ajax implementation of flicker-free scheduled refresh page example code. For more information, please follow other related articles on the PHP Chinese website!