This file contains hidden or 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
<script> | |
// JSON+LD Schema :: PDP | |
(function(){ | |
var minPrice = null; | |
var maxPrice = null; | |
var isMaster = true; | |
var pdpData = app.pdp && app.pdp.data != undefined ? app.pdp.data : window.pageData != undefined ? window.pageData : {}; | |
var productData = app.product && app.product.data && app.product.data.cache && app.product.data.cache[pdpData.productID] != undefined ? app.product.data.cache[pdpData.productID] : app.config && app.config.products && app.config.products[pdpData.productID] ? app.config.products[pdpData.productID] : null; | |
This file contains hidden or 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
var oldObj = { | |
a:{value:1}, | |
b:{value:2}, | |
c:{value:3} | |
} | |
var newObj = { | |
// no a | |
b:{value:4}, // value change | |
c:{value:3}, |
This file contains hidden or 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(){ | |
var el = document.querySelector('.footer-wrapper'), | |
rect = el.getBoundingClientRect(), | |
scrollTopOffset = window.pageYOffset || document.documentElement.scrollTop, | |
offsetFromBottom = document.documentElement.scrollHeight - (rect.top + scrollTopOffset + rect.height); | |
return offsetFromBottom > 0; | |
})(); |
This file contains hidden or 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
var smarti = require("Smartibot"); | |
// why did this work with E1 when plugged into E2 | |
var g = require("Smartibot-display").connect(smarti.E2); | |
var dist = require("Smartibot-distance").connect(smarti.E1); | |
var m1 = false; | |
var eyes = false; | |
// BTN A | |
setWatch(function(e) { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>STATIC SITE SEARCH</title> | |
</head> | |
<body> | |
<h1>STATIC SITE SEARCH</h1> | |
<label for="queryz">Query:</label> | |
<input type="text" id="queryz" name="query" maxlength="80" size="10" autocomplete="off"> |
This file contains hidden or 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(){ | |
// Prepend | |
// put HTML string AFTER OPENING tag of another element | |
// (example hard to see because hidden behind promo drawer tag) | |
var selector = '#mainContent'; | |
var htmlString = ''+ | |
'<div style="text-align:center;" class="redText">'+ | |
'<h2>Hello World - PREPEND</h2>'+ | |
'</div>'; |
This file contains hidden or 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() { | |
// Extend XMLHttpRequest to get info of all XHR requests | |
// TODO: Add Fetch extension | |
// https://stackoverflow.com/questions/5202296/add-a-hook-to-all-ajax-requests-on-a-page | |
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress | |
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest | |
// https://developer.mozilla.org/en-US/docs/Web/Events/load | |
This file contains hidden or 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
/* | |
JavaScript MutationObserver | |
https://caniuse.com/#feat=mutationobserver | |
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver | |
*/ |
This file contains hidden or 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
/* | |
JavaScript Proxy | |
First read this... | |
https://hacks.mozilla.org/2015/07/es6-in-depth-proxies-and-reflect/ | |
Above is an old article, proxy is available, except in IE... | |
https://caniuse.com/proxy |
This file contains hidden or 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 getSelectParams(){ | |
var selectParamsArr = []; | |
var paramsArr = window.location.search.replace('?','').split('&'); | |
for(var i=0,len=paramsArr.length;i<len;i++){ | |
if(/cgid=|cid=|sid=/.test(paramsArr[i]) ){ | |
selectParamsArr.push(paramsArr[i]); | |
} | |
} | |
return selectParamsArr.join('&'); | |
} |
NewerOlder