-4
Hello. I have a script, but it only opens when it comes from certain websites. How do I make it always open without having to referrer and keep cookies? Thank you since.
function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i += 1) {
x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x === c_name) {
return (unescape(y))
}
}
}
// <![CDATA[
jQuery(function() {
var sel = 'iframe';
var x = document.referrer;
var y = x.search("facebook");
var z = x.search("//t.co");
var w = x.search("twitter");
if (((y > 0) || (z > 0) || (w > 0)) && (getCookie('clickedad'))) {
$(sel).hide();
}
$(sel).iframeTracker({
blurCallback: function() {
var now = new Date();
var time = now.getTime();
time += 12*60*60*1000;
now.setTime(time);
document.cookie =
'clickedad=1' +
'; expires=' + now.toUTCString() +
'; path=/';
$(sel).fadeOut();
$('#escuro').hide();
$('#tela').hide();
}
});
});
// ]]>
$(function() {
var x = document.referrer;
var y = x.search("facebook");
var z = x.search("//t.co");
var w = x.search("twitter");
if (((y > 0) || (z > 0) || (w > 0)) && (!getCookie('clickedad'))) {
var xbanner = 1 + Math.floor(Math.random() * 100);
var ybanner = 1 + Math.floor(Math.random() * 100);
$('body').prepend('<div id="escuro" style="width:100%; height:100%; z-index:999999; background:#000; opacity:0.8; -moz-opacity:0.7; filter:alpha(opacity=70); position:fixed;"></div><div id="tela" style="width:970px; height:400px; top:370px; left:50%; margin-top:' + (-ybanner) + 'px; margin-left:' + (-525 - xbanner) + 'px; position:absolute; z-index:9999999;"><a href="http://goo.gl/7GGRwe" target="_blank"><img src="http://i.imgur.com/cP5movw.png" border="0" width="970" height="400" /></a></div>');
$('#anuncioad').css({
"position": "relative",
"z-index": "99999999",
"opacity": "0",
"-moz-opacity": "0",
"filter": "alpha(opacity=0)"
});
setTimeout(function() {
$('#escuro').hide();
$('#tela').hide();
}, 120000);
}
});
I pulled the whole line out and it didn’t work.. :(
– Hugo Leonardo
Only part of it was to be taken away?
– Hugo Leonardo
@Hugoleonardo you removed the whole line and it didn’t work? gave some error?
– Sergio
No error, but the script did not open
– Hugo Leonardo