Created
April 16, 2013 18:33
-
-
Save christophergregory/5398359 to your computer and use it in GitHub Desktop.
Keep IE from caching ajax call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCart(callback) { | |
var rnum = Math.floor((Math.random()*1000000000)+1), | |
rand_url = '/cart.js?' + rnum; | |
jQuery.getJSON(rand_url, function (cart, textStatus) { | |
if ((typeof callback) === 'function') { | |
callback(cart); | |
} | |
else { | |
Shopify.onCartUpdate(cart); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment