function tscCall(dto) {
const request = new XMLHttpRequest();
request.open('GET', dto.pu + '/search/tsc.php?' + dto.tscQs);
request.send();
}
function isFacebookCookieSet() {
const cookieArray = decodeURIComponent(document.cookie).split(';');
for (let i = 0; i < cookieArray.length; i++) {
let c = cookieArray[i].trim(); // Using trim method to remove leading and trailing whitespaces
if (c.indexOf("_fbp=") === 0) {
return true;
}
}
return false;
}
if (dto.tsc) {
if (dto.fbpCheck == undefined) {
tscCall(dto);
} else {
let x = 0;
const intervalID = setInterval(function () {
const isSet = isFacebookCookieSet()
if (isSet || x === 9) {
tscCall(dto);
clearInterval(intervalID);
}
x++;
}, 100);
}
}
x server