※本サイトに表示の税込価格は消費税率10%で計算し、小数点以下は四捨五入しております。
- Share
-
window.addEventListener('load',function() {
const links = document.getElementsByTagName('a');
const listener = function(e) {
const xdomain = ['jp.toto.com', 'order.toto.jp'];
if (typeof URLSearchParams === 'undefined') return;
if (!e.target.href) return;
if (!xdomain.some(function(value) { return e.target.hostname.indexOf(value) !== -1}))
return ;
const params = new URLSearchParams((new URL(window.location)).search.slice(1));
const yclid = params.get('yclid');
if (yclid) {
let lurl = new URL(e.target.href);
let lparam = new URLSearchParams(lurl.search.slice(1));
lparam.set('yclid', yclid);
lurl.search = lparam.toString();
e.target.href = lurl.toString();
}
};
for (let i = 0; i< links.length; i++)
links[i].addEventListener('click', listener);
});