Ajax implementation of flicker-free scheduled refresh page example code

韦小宝
Release: 2018-01-09 09:56:10
Original
2242 people have browsed it

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


Copy after login

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:

Ajax refresh problem

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!