Reputation: 3392
I just get:
8:21 Uncaught TypeError: Cannot read property 'set' of undefined
for:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
<script src="~/Scripts/jquery.cookie.js"></script>
<script>
$.cookies.set('TEST', "VALUEEEE", { path: '/' }); // <-- errs here
</script>
I'm in MVC5, tried this directly on a page, in layout, in partial.... no go anywhere... simply get this error no matter what. File is in place from NuGet package and referenced as you see here... Confirmed jQuery loaded, and jquery cookie file loaded...
Cannot get this to work... any ideas?
Upvotes: 1
Views: 99
Reputation: 1567
It should be like below
var cook = $.cookie('TEST', "VALUEEEE", { path: '/' });
Upvotes: 2