Ajax with Get Refresh page element in IE Invalid solution ~ ~

Source: Internet
Author: User

summarize the solution :
Under IE, the use of Ajax to request a page, usually because of the cache for the reason and return to the previous results, causing confusion, [that is, the get mode, get data, because the sending parameters and address are consistent, so IE browser will be taken from the cache, not to request the server side, and the post method because of different parameters, This problem does not occur] and this is not the case under FF. To be unaffected by the cache, you can do this:

IE Access Policy :
Internet Options--browsing history--settings--Options for temporary Internet files are changed every time you visit a webpage
1: Add a random function to the page after the AJAX request, we can use the random time function

After the URL that is sent by JavaScript, add
1 T=math.random ()

For example, this :
1 url+ "&" + "t=" +math.random ();//or New Date ();

Add www.hake.cc after the URL parameter
1 "? timestamp=" + New Date (). GetTime ();

the best way :
1 $.ajaxsetup ({cache:false})
This is done for all AJAX requests on the page. You don't have to change the N interfaces that have already been completed

The above is the method of online predecessors, and I use the post-opportunistic to submit ~ ~ Haha ~ ~

Ajax with Get Refresh page element in IE Invalid solution ~ ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.