Hello I'm stuck with a situation and I'm not capable to get JS-Cookie v2.1.3 working as expected. I'm thinking that there is some browser issues involved on this point, but I can't determine it exactly so I wish someboduy could give some light My goal is to set up a language cookie on my site, I have the following code:
jQuery(document).ready(function($) {
$('#botEn').click(function(e) {
Cookies.set('idioma', 'en', {
expires: 7,
path: '/'
});
$('.alert').html('<p>Btn english >> cookie:'+Cookies.get('idioma')+'</p>');
});
$('#botEs').click(function(e) {
Cookies.set('idioma', 'es', {
expires: 7,
path: '/'
});
$('.alert').html('<p>Btn español >> cookie:'+Cookies.get('idioma')+'</p>');
});
});
https://jsfiddle.net/faridsilva/vrqvLfk2/18/
This code only works in chrome (my version is 56.0.2924.87 64-bit), but firefox 51.x and safari 10.x always returns "undefined"
The same happens to me with Dustin Simpson example in his fiddle which he says is working fine as reply to this question.