jStorage icon indicating copy to clipboard operation
jStorage copied to clipboard

Cannot call method 'set' of undefined

Open brunotiago opened this issue 12 years ago • 2 comments

Hi,

I have this code:

function selectChecked() { var selected = new Array(); var chk_arr = document.getElementsByName("checkbox[]"); var chklength = chk_arr.length;
for(k=0;k< chklength;k++) { if (chk_arr[k].checked == true) selected.push(chk_arr[k].value); } $.jStorage.set("links", selected); }

And have this error: Cannot call method 'set' of undefined

I even try change selected to "teststring" and I have the same error

brunotiago avatar Oct 25 '12 09:10 brunotiago

Are you sure you have jStorage loaded on your page since $.jStorage can be undefined only if it not loaded on the page. Additionally I'd suggest you to upgrade Prototype version.

andris9 avatar Oct 31 '12 21:10 andris9

this is happening on sites that use require.js

whatsdis avatar Apr 17 '14 00:04 whatsdis