Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call method 'set' of undefined #27

Open
brunotiago opened this issue Oct 25, 2012 · 2 comments
Open

Cannot call method 'set' of undefined #27

brunotiago opened this issue Oct 25, 2012 · 2 comments

Comments

@brunotiago
Copy link

Hi,

I have this code:

<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script> <script src="jstorage.js"></script>

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);
}
</script>

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

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

@andris9
Copy link
Owner

andris9 commented Oct 31, 2012

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.

@whatsdis
Copy link

this is happening on sites that use require.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants