Home > Web Front-end > JS Tutorial > body text

The problem that IE8 cannot refresh every time when using ajax access

亚连
Release: 2018-05-23 16:25:54
Original
1621 people have browsed it

This article mainly introduces the relevant information on the problem that IE8 cannot be refreshed every time when using ajax access. It is very good and has reference value. Friends who need it can refer to it

Introduction to AJAX

AJAX = Asynchronous JavaScript and XML (Asynchronous JavaScript and XML).

AJAX is not a new programming language, but a new way of using existing standards.

AJAX is the art of exchanging data with a server and updating parts of a web page without reloading the entire page.

The problem that IE8 cannot be refreshed every time when using ajax to access it is introduced as follows:

I recently discovered that using ajax to access the background and ie8 to access it, The value can be returned normally for the first time, and the background will not be executed thereafter, and the result of the first access will always be returned.

There is no problem with IE9, IE10, etc., and there is no problem with Chrome, other browsers.

After testing, it was found that ie8 cached the result obtained for the first time, so it would not be submitted to the background the second time.

Add a random number after the ajax request to make each request inconsistent, and ie will not obtain the results from the cache.

For example, after the ajax request, add "....&random=" Math.random(); so that each request is inconsistent and ie will not fetch the results from the cache. .

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

How Ajax calls the restful interface to transmit Json format data (with code)

Boa server Ajax and cgi communication under (graphic tutorial)

Ajax Struts2 implements verification code verification function (graphic tutorial)

The above is the detailed content of The problem that IE8 cannot refresh every time when using ajax access. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template