IE send Ajax request to return to the previous result solution

Source: Internet
Author: User
Tags browser cache

This article mainly introduces IE to send Ajax request to return the last results of the solution, the need for friends can refer to the

Problem arises: 1. IE will only create an AJAX request below, put the response results in the browser cache the next time you call the AJAX request to read the Get mode from the cache, the data is obtained, because the sending parameters and address are consistent, so IE browser will be taken from the cache, but not to request the server side, and the post method because of the different parameters will not produce this problem 2. Firefox follows each activation event to recreate an AJAX request solution: 1: After the Ajax-requested page, add a random function, we can use the random time function in the JavaScript sent by the URL after the T=math.random () such as: UR l+ "&" + "t=" +math.random () or new Date ();    After the URL parameter, add "? timestamp=" + New Date (). GetTime (); 2. Code as follows: $.ajax ({type: "POST", Async:false,//Set sync mode cache:false,//cache Url:url, Data:data, Success:fu    Nction (data) {///After successful return of the value of the Operation}}); The solution is cache:false.
Related Article

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.