Access GET Parameters With Coffeescript
I've been working on a pure JavaScript based search engine for this static website and needed to access a get parameter within the URL.
I found a few solutions online but they usually made use of jQuery or weren't in CoffeeScript. A few others would only extract an individual named parameter at a time. The following will return all of them in JavaScript's equivalent of a hash (or dictionary if you prefer) in the form of an object.
If compiled and included in a page the above will print out the parameters as a hash object to the console.
coffeescript development programming
5cc61bdd @ 2024-07-15