Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- var URL = 'https://www.factory54.co.il/on/demandware.store/Sites-factory54-Site/iw_IL/WishlistMini-Show';
- var parser = new DOMParser();
- var doc = '';
- var data = null;
- var xhr = new XMLHttpRequest();
- try {
- xhr.withCredentials = true;
- xhr.addEventListener('readystatechange', function () {
- if (this.readyState === 4) {
- doc = parser.parseFromString(this.responseText, 'text/html');
- var wishlistCounter = doc.querySelector('.wishlist-popover .popover-title');
- if (wishlistCounter) {
- window.localStorage.setItem('adoricWishlistData', wishlistCounter.textContent.replace(/\D/g, ""));
- } else {
- window.localStorage.setItem('adoricWishlistData', 0);
- }
- }
- });
- xhr.open('GET', URL);
- xhr.setRequestHeader('cache-control', 'no-cache');
- xhr.send(data);
- } catch(error) {
- console.log(error);
- }
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement