Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function getCookieParam(cname) {
- var name = cname + "=";
- var decodedCookie = decodeURIComponent(document.cookie);
- var ca = decodedCookie.split(";");
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == " ") {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return false;
- }
- function getDynamicData(adoricCampaigId) {
- var userToken = getCookieParam('com.silverpop.iMAWebCookie');
- if (userToken) {
- var URL = 'https://www.pelephone.co.il/digitalsite/handlers/service.ashx?action=GetPersonalInfo&lcid=1037&visitorKey=';
- URL += userToken;
- URL += '&id=' + adoricCampaigId;
- var data = null;
- var xhr = new XMLHttpRequest();
- xhr.addEventListener('readystatechange', function() {
- if (this.readyState === 4) {
- var response = JSON.parse(this.responseText);
- if (response.IsExists) {
- sessionStorage.setItem(adoricCampaigId, this.responseText)
- }
- }
- });
- xhr.open('GET', URL);
- xhr.setRequestHeader('cache-control', 'no-cache');
- xhr.send(data);
- }
- }
- setTimeout(function() {
- window.adoric &&
- adoric.lightboxes &&
- adoric.lightboxes.forEach(function(item) {
- if (!window.sessionStorage.getItem(item.options.campaignId)) {
- getDynamicData(item.options.campaignId);
- }
- });
- }, 2000);
- })();
- </script>
Add Comment
Please, Sign In to add comment