I use jQuery to get the cart data contents from Shopify and display it on another site. It just stopped working. Google Chrome shows the request is 'failed' and when I open this request in another tab Google shows:
Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.
When I Google for this message I only get reports saying it has something todo with compression. Which is a bit difficult to debug as Shopify is a hosted webshop.
I use this method to get the cart contents:
Shopify.getCart = function(callback) {
console.log("getCart")
jQuery.ajax({url: 'http://shop-here/cart.json', dataType: 'jsonp', cache: false, success:
function(cart){
console.log("response: " + callback)
console.log(cart)
if (callback !== undefined && (typeof callback) === 'function') {
callback(cart);
}
else {
Shopify.onCartUpdate(cart);
}
}
});
};
What is going wrong and how do I fix this?
Shopify fixed the issue. As the error messages indicated, it was an error on the Shopify servers.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.