1

Im using the jquery cookie plugin and getting an unexpected string error when attempting to set it.

jQuery('#select').change(function() { if(jQuery(this).val() == "defaultselect"){ jQuery.cookie('mycookie':'123456789'); // This line throws the error } return false; }); 

1 Answer 1

2

You have a syntax error : should be ,

jQuery('#select').change(function() { if(jQuery(this).val() == "defaultselect"){ jQuery.cookie('mycookie','123456789'); //`:` should be `,` } return false; }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.