Profile
Achievement
EvanHahn's Recent Snippets
- All /
« Prev 1 Next »
Add the "no-js" class to your topmost html element, so you can use CSS to style JavaScript-free pages. This snippet will then replace that tag with "js", allowing you to style pages with JavaScript.
The excellent [HTML5 Boilerplate](http://html5bo...
0
2291
posted 12 years ago by EvanHahn
Here's how to use this:
* To access something in the local storage, type `Evan.local('name')`. You may need to use `JSON.parse()` on this result. Returns `null` if nothing's there.
* To assign something in the local storage, type `Evan.local('nam...
1
762
posted 12 years ago by EvanHahn
This prepends a `#` if it's not already there. Useful when doing jQuery selectors.
0
620
posted 12 years ago by EvanHahn
`Object.create(null)` is a more memory-efficient way to make objects, but it's not supported in all versions of JavaScript, so you can do the "old-fashioned" `{}` if that function isn't available.
0
860
posted 12 years ago by EvanHahn