jquery cookie集引发意外字符串错误
我正在使用jquery cookie插件,在尝试设置时遇到了一个jquery cookie集引发意外字符串错误,jquery,cookies,Jquery,Cookies,我正在使用jquery cookie插件,在尝试设置时遇到了一个意外的字符串错误 jQuery('#select').change(function() { if(jQuery(this).val() == "defaultselect"){ jQuery.cookie('mycookie':'123456789'); // This line throws the error } return false; }); 您有一个语法错误:应该是, j
意外的字符串错误
jQuery('#select').change(function() {
if(jQuery(this).val() == "defaultselect"){
jQuery.cookie('mycookie':'123456789'); // This line throws the error
}
return false;
});
您有一个语法错误
:
应该是,
jQuery('#select').change(function() {
if(jQuery(this).val() == "defaultselect"){
jQuery.cookie('mycookie','123456789'); //`:` should be `,`
}
return false;
});