added option to disable the cache

This commit is contained in:
Sebastian Sdorra
2013-01-08 15:31:24 +01:00
parent 1d860a24f9
commit 04ea3d9827

View File

@@ -44,6 +44,7 @@
var defaults = { var defaults = {
maxItems: -1, maxItems: -1,
disableCache: false,
paramName: "url", paramName: "url",
itemClass: "feeds", itemClass: "feeds",
errorTitle: "Error", errorTitle: "Error",
@@ -59,9 +60,13 @@
function loadFeeds(){ function loadFeeds(){
loadingView(); loadingView();
var feedUrl = url;
if ( options.disableCache ){
feedUrl += "?_dc=" + new Date().getTime();
}
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: url, url: feedUrl,
dataType: "xml", dataType: "xml",
success: renderFeeds, success: renderFeeds,
failure: renderErrorMsg failure: renderErrorMsg