Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="lx_sticky_wrapper"></div>
- <script>
- (function(w){
- function getCookie(name) {
- let matches = document.cookie.match(new RegExp(
- "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
- ));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- }
- function setCookie(name, value, options = {}) {
- if (options.expires instanceof Date) {
- options.expires = options.expires.toUTCString();
- }
- let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
- for (let optionKey in options) {
- updatedCookie += "; " + optionKey;
- let optionValue = options[optionKey];
- if (optionValue !== true) {
- updatedCookie += "=" + optionValue;
- }
- }
- document.cookie = updatedCookie;
- }
- function showCode(p, c) {
- var div = document.createElement('div');
- div.innerHTML = c;
- p.appendChild(div);
- while (div.firstChild) p.insertBefore(div.firstChild, div);
- p.removeChild(div);
- var scripts = p.getElementsByTagName("script");
- Array.from(scripts).forEach(function(script, index, array) {
- var newScript = document.createElement('script');
- if(typeof script.src !== "undefined" && script.src && script.sr !== "")
- {
- newScript.src = script.src;
- newScript.className = script.className;
- p.appendChild(newScript);
- }
- else
- {
- var data = (script.text || script.textContent || script.innerHTML || "");
- newScript.className = script.className;
- newScript.type = script.type;
- newScript.appendChild(document.createTextNode(data));
- p.appendChild(newScript);
- }
- p.removeChild(script);
- });
- }
- if(!getCookie("lx_sticky_shown"))
- {
- var code = "<scr" + "ipt async type='text/javascript' src='//s.clickiocdn.com/t/common_258.js'><\/scr" + "ipt>" +
- "<scr" + "ipt class='__lxGc__' type='text/javascript'>" +
- "((__lxGc__=window.__lxGc__||{'s':{},'b':0})['s']['_209992']=__lxGc__['s']['_209992']||{'b':{}})['b']['_659149']={'i':__lxGc__.b++};" +
- "<\/scr" + "ipt>"; // code to insert
- var parent = document.querySelector("#lx_sticky_wrapper");
- showCode(parent, code);
- setCookie("lx_sticky_shown", 1, {secure: true, 'expires': 'session'})
- }
- })(window);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement