ajax - Does jquery require timestamp on GET Calls in IE7? -


Please refer to the jQuery code below, it is used to endorse some search results

  paginate: function () {$ ("#wishlistPage .results") HTML (.jpg 
"); var url = BASE_URL +" wishlist / wish list_pagged / "; $ .ajax ({type: "GET", URL: that URL, data: {sort_by: $ ('# componentSortOrder input: hidden'.) Val (), offset: My.WishList.offset, per_page: 10, timestamp: New date () GetTime ()}, success: work (transport) {$ ("# wish list page results"). Html (transport);}});},

on my problem page The point is not to point out, the point is when I have to call this function, when something goes on the other side of a page that removes some search results, it results in the older IE7, the other browsers are ok Works if timestamp is added: new date (). Match-time () part fixed it IE problem

I know why this happens in jQuery? Do I need to include URL in timestamp parameter to avoid caching in all jQuery Ajax calls?

In short, yes IE generally does not follow the rules of caching , But jQuery can add this parameter to you automatically, just use this way:

  $ .ajax ({type: "GET", url: url, cache : False, data: {sort_by: $ ('# componentSortOrder input: hidden'). Val (), offset: My.WishList.offset, per_page: 10, timestamp: new date () getTime ()}, success: Function (transport) {$ ("# wish list page results"). Html (transport);}});  

The result is the same, it adds a timestamp for the URL.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -