Does jquery require timestamp on GET Calls in IE7?
Posted
by Mithun P
on Stack Overflow
See other posts from Stack Overflow
or by Mithun P
Published on 2010-06-15T10:02:20Z
Indexed on
2010/06/15
10:12 UTC
Read the original article
Hit count: 145
Please see the jQuery code below, it used to paginate some search results
paginate: function() {
$("#wishlistPage .results").html("<div id='snakeSpinner'><img src='"+BASE_URL+"images/snake.gif' title='Loading' alt='...'/></div>");
var url = BASE_URL+"wishlist/wishlist_paginated/";
$.ajax({
type: "GET",
url: url,
data: {
sort_by:$('#componentSortOrder input:hidden').val(),
offset:My.WishList.offset,
per_page: 10,
timestamp: new Date().getTime()
},
success: function(transport){
$("#wishlistPage .results").html(transport);
}
});
},
My issue is not with the pagination, issue is when i need to call this same function when something happed to other part of the page which remove some search results, it brings the old results in IE7, other browsers works fine. So added the timestamp: new Date().getTime() part. That fixed the IE issue.
I want o know why this happens in jQuery? Do I need to include a timestamp parameter to URL to avoid caching in all jQuery Ajax calls?
© Stack Overflow or respective owner