I cant get a cookie to write through jQuery.
This is the function:
<script type="text/javascript">
$(document).ready(function() {
$('.jp-volume-bar,.jp-volume-bar-value').click(function(){
var volval=$('.jp-volume-bar-value').width();
var voltot=$('.jp-volume-bar').width();
var vol=volval/voltot;
$.cookie('jp_volume', vol, { expires: 7, path: '/'});
});
});
</script>
I have confirmed that the three variables are outputting a value.
But checking in chromes cookie logs, and using the PHP page to output the cookie value, both result with nothing appearing, so jQuery isnt actually writing the cookie.
Is there an issue with my code?
This action requires a jQuery cookie plugin. http://archive.plugins.jquery.com/project/Cookie