troubleshooting Question

Firefox addon: Checking, setting and getting from localstorage

Avatar of CrAppl
CrAppl asked on
JavaScriptWeb BrowsersWeb Development
6 Comments1 Solution738 ViewsLast Modified:

In the Google Chrome browswer this works perfectly:
if(localStorage['list_expiry_date'] === undefined) 
{alert("in local storage");
localStorage['list_expiry_date'] ="P";}
		{alert("Local storage exists and has the value of: "+localStorage['list_expiry_date']);}

Open in new window

But in firefox 4 it's throwing an error, so my question is:
How do you
1- check to see if localStorage['list_expiry_date'] already exists?
2- set the value for localStorage['list_expiry_date']
3-get the value from localStorage['list_expiry_date']


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros