Ajax Caching Problem Requestheader_javascript tips

Source: Internet
Author: User
Copy Code code as follows:

var paras= "Ajaxflag=getmarkerids";
var myajax=new ajax.request (
"Addinfohandler.ashx",
{method: ' Get ', parameters:paras,oncomplete:showgetmarkeridsresponse}
);

Because I have a switch database operation, the first time into the database A, the list is loaded correctly, click the node (AJAX) map to display a data, but click IE back and then into the database B of the TreeView, the list loaded correctly (load list is not Ajax), Click on the node map to display the data is still a data (Ajax), I set a breakpoint in the addinfohandler.ashx, found that the above operation time into a database breakpoint hit, and into the B database did not enter a breakpoint, but I am really strange, did not enter the page unexpectedly Ajax has returned data, and the same as the last time, should be the use of the caching mechanism. The last information on the Internet was changed as follows:
Copy Code code as follows:

var myajax=new ajax.request (
"Addinfohandler.ashx",
{method: ' Get ', requestheaders: [' Cache-control ', ' no-cache ', ' if-modified-since ', ' 0 '],parameters:paras,oncomplete: Showgetmarkeridsresponse}
);


The following can refer to previously published articles
Http://www.jb51.net/article/22074.htm
Introduction to Response.setheader parameters and usage
Detailed source reference: Http://www.jb51.net/article/16437.htm
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.