Recently, I encountered a problem. My treeview click node displays map elements through prototype ajax.
The 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:
The 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