Profile
Achievement
pmw57's Recent JavaScript Snippets
- All /
« Prev 1 Next »
Brendan Eich is working on officially adding Math.TAU to JavaScript.
Until JavaScript has full support for the Math.TAU constant, you can add the following at the start of your programs to add support for the TAU constant.
0
1900
posted 11 years ago by pmw57
Code from https://snipt.net/geekyjohn/get-url-param/ updated so that most jslint issues are resolved, and updated the return to use a guard condition instead of a separate if statement.
1
3178
posted 13 years ago by pmw57
Standard hasClass, addClass, and removeClass functions.
- reworked so that jsLint is happy about them
- removeClass function trims things after removing a class name
- tests help to ensure that all common use-cases are covered
2
3615
posted 13 years ago by pmw57
Cleaned up (with the help of jslint.com) versions of cookie handling functions
0
4745
posted 15 years ago by pmw57