JS Cookie Plugin + If Statement Not Working
I'm trying to use the JS Cookie Plugin to read the value of a cookie and
include a notification bar (Hello Bar) if the value is not 1.
Here's my code:
<!-- HelloBar code start -->
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
if($.cookie('returning_user') !== '1') {
new HelloBar(12345,12345);
}
</script>
<!-- HelloBar code end -->
Is !== the right operator?
Am I testing the right thing (that it's not equal to 1)?
By putting 1 in quotes, am I testing for a string when I really want an
integer?
No comments:
Post a Comment