javascript - jquery cookie issue: $.cookie is not a function -
i know question has been asked multiple times. looked @ many answers couldn't find solution.
i trying load jquery.cookie.js script. here how:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script type="text/javascript" src="scripts/jquery.cookie.js"></script> <script type="text/javascript" src="scripts/javascript.js"></script>
this javascript:
$(document).ready(function () { var jobstats_class = $.cookie('jobstats'); // add toggle feature $('.jobstats caption').click(function () { $('.jobstats th,.jobstats td').slidetoggle('1000'); }); $('.ricsubscriptions caption').click(function () { $('.ricsubscriptions th,.ricsubscriptions td').slidetoggle('1000'); }); $('.trthjobstatus caption').click(function () { $('.trthjobstatus th,.trthjobstatus td').slidetoggle('1000'); }); });
thanks help!
since version 2.0, jquery-cookie
project has moved js-cookie
project.
now can't handle cookies $
variable (because library didn't use special functions of jquery). now, have use cookies
variable :
create cookie
//old $.cookie('name', 'value', { expires: 7, path: '/' }); //new cookies.set('name', 'value', { expires: 7, path: '/' });
read cookie
//old $.cookie('name'); //new cookies.get('name');
read cokies
//old $.cookie(); //new cookies.get();
delete cookie
//old $.removecookie('name'); //new cookies.remove('name');
Comments
Post a Comment