Free javascript Hosting


ackorspollscript.js

Uploaded on Feb 12 2022 22:58 by lakshya.pratap.mail

window.addEventListener("load", function(){
var NPLISTENERS = NPLISTENERS || {};
if (!NPLISTENERS['message']) {
NPLISTENERS['message'] = "event";
window.addEventListener('message', function (e) {
let eventName = e.data[0];
switch (eventName) {
case 'setHeight':
let data = e.data[1];
let iframeId = e.data[2];
let iframeDiv = document.querySelectorAll('[id^="np-"]');
if (!!iframeDiv) {
for (let index = 0; index < iframeDiv.length; index++) {
const element = iframeDiv[index];
if (!!element && element.id == "np-" + iframeId) {
element.children[0].style.height = data +'px';
break;
}
}
}
break;
}
}, false);
}

let currentScript = document.currentScript;
let targetAttribute = currentScript.getAttribute("data-target");
let baseUrl = "https://netpoll.in/embed?pid=";
const element = document.getElementById(targetAttribute);
if (!!element) {
let iFrameSrc = baseUrl + element.id.substring(3);
var btn = document.createElement("iframe");
btn.src = iFrameSrc;
btn.loading = 'lazy';
btn.style.height = '0px';
btn.style.border = "0px";
btn.style.width = "100%";
btn.style.transition = "1s";
btn.scrolling = "no";
element.appendChild(btn);
}
}());

document.getElementById(div.underlink).style.display = 'none';

Back to list