Why ajax data cannot be updated and solved; why ajax data cannot be updated
Causes and solutions for the failure to update ajax data:
You may have encountered such a problem that the name has been submitted to update data using ajax, but the content displayed on the browser is still original and remains unchanged, the following describes the causes and solutions for this problem.
Cause:
This is mainly caused by browser cache, especially for IE browsers. Although it improves the browsing speed, it also causes the inability to update in real time.
Solution:
1. Add anyAjaxObj. setRequestHeader ("If-Modified-Since", "0") before ajax sends a request ").
2. Add anyAjaxObj. setRequestHeader ("Cache-Control", "no-cache") before ajax sends a request ").
3. Add a random number after the URL: "fresh =" + Math. random ().
4. Add "nowtime =" + new Date (). getTime () "after the URL ().
5. If jQuery is used, you can directly set $. ajaxSetup ({cache: false }). In this way, all the ajax operations on the page will execute this statement without the need to save the statement.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 10661.
For more information, see: http://www.softwhy.com/jquery/