DEV Community

Discussion on: Easy way to get parameters from a URL

Collapse
 
jsn1nj4 profile image
Elliot Derhay

Nice! Didn't know about that.

Previously I would split the url at the ? and then split the second array element (the string containing the query string) at each & (if it existed) and then split each new array element at the = to get the parameter list.

Of course I also found that on Stack Overflow a while ago. I definitely didn't invent that one.

Collapse
 
ma7eer profile image
Maher Alkendi

Ya I used to do the same thing until I fell on this trick from... Stack Overflow haha

From there I went to MDN to understand the API more. Hopefully it gets support from IE at some point