Skip to content

Instantly share code, notes, and snippets.

@julienetie
Created April 5, 2015 18:12
Show Gist options
  • Save julienetie/37b440e5b8f1db1c4db0 to your computer and use it in GitHub Desktop.
Save julienetie/37b440e5b8f1db1c4db0 to your computer and use it in GitHub Desktop.
Check for local storage support
function hasLocalStorage() {
try {
return 'localStorage' in window && window['localStorage'] !== null;
} catch (e) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment