CasJ
11-16-2012, 08:29 PM
Hello there!
So basically what i want to get is a script that will create a cookie after a function is executed. But on forehand it will be checked if that cookie already exists. When this is the case i don't want the function to be executed.
<script type="text/javascript">
function csearch(DBadblockblocker) {
var str = document.cookie;
var zstr = DBadblockblocker + "=";
var start = str.indexOf(zstr, 0);
if(start == -1) {
// If cookie is not detected -> Check if Adblock is enabled
adblockcheck();
// After the popup a cookie called DBadblockblocker met value true word aangemaakt
document.cookie = "DBadblockblocker=true;path=/";
alert('Cookie is aangemaakt');
// Give alert when cookie has been made
} else {
alert('Cookie bestond al');
// Give alert when cookie already excists
}
}
</script>
I've added these 2 alerts because it was not working, but i just can't find the problem.
Hope you guys can help me!
So basically what i want to get is a script that will create a cookie after a function is executed. But on forehand it will be checked if that cookie already exists. When this is the case i don't want the function to be executed.
<script type="text/javascript">
function csearch(DBadblockblocker) {
var str = document.cookie;
var zstr = DBadblockblocker + "=";
var start = str.indexOf(zstr, 0);
if(start == -1) {
// If cookie is not detected -> Check if Adblock is enabled
adblockcheck();
// After the popup a cookie called DBadblockblocker met value true word aangemaakt
document.cookie = "DBadblockblocker=true;path=/";
alert('Cookie is aangemaakt');
// Give alert when cookie has been made
} else {
alert('Cookie bestond al');
// Give alert when cookie already excists
}
}
</script>
I've added these 2 alerts because it was not working, but i just can't find the problem.
Hope you guys can help me!