I have this PHP line, but is there a very similar, simple Javascript way of doing it?
<? if(!isset($_COOKIE["eucookie"]))
{ ?>
content
<?php
}
?>
Thanks
Posted 15 February 2013 - 08:07 AM
<? if(!isset($_COOKIE["eucookie"]))
{ ?>
content
<?php
}
?>
Posted 15 February 2013 - 08:56 AM
if (document.cookie.indexOf('eucookie=') == -1){
//cookie is not set
}
else {
//cookie is set
}
Posted 15 February 2013 - 09:04 AM
<script>
if (document.cookie.indexOf('eucookie=') == -1){
//cookie is not set
document.write('hello');
}
else {
//cookie is set
document.write('bye');
}
</script>
<a href="javascript:" onclick="SetCookie('eucookie','eucookie','time()+31556926')">
Posted 15 February 2013 - 09:15 AM
Posted 15 February 2013 - 09:20 AM
0 members, 0 guests, 0 anonymous users