if (typeof(Storage) !== "undefined") { // Code for localStorage/sessionStorage. alert("Good to go: "+typeof(Storage)); } else { // Sorry! No Web Storage support.. alert("fuck..."); }