197
rated 0 times
[
198]
[
1]
/ answers: 1 / hits: 30869
/ 9 Years ago, sun, october 18, 2015, 12:00:00
I'm using the below code to check if a cookie exists with a certain value then do something.
$(document).ready(function() {
if (document.cookie.indexOf('samplename=itsvalue')== -1 ) {
alert(cookie);
}
});
It always displays the alert whether the cookie exists or not. What I'm doing wrong here?
More From » jquery