Ajax cache problem requestheader

Source: Internet
Author: User

Copy codeThe Code is as follows:
Var paras = "ajaxFlag = getMarkerIDs ";
Var myAjax = new Ajax. Request (
"AddInfoHandler. ashx ",
{Method: 'get', parameters: paras, onComplete: showGetMarkerIDsResponse}
);

Because I have an operation to switch the database, when I first enter database A, the list is correctly loaded. Click the node (ajax) map to display data, however, after you click ie, enter the treeview of database B. The list is correctly loaded (the load list is not ajax), and the data displayed on the node map is still ajax. I am in AddInfoHandler. when I set A breakpoint in ashx, I found that when I performed the above operation again, I hit A breakpoint in database A, but I didn't even break A breakpoint in database B, but I was surprised that ajax also returned data even when I didn't enter the page, the cache mechanism should be used the same as the previous one. Finally, the information found on the internet is changed as follows:
Copy codeThe Code is 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 be referenced in previous 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.