Tag Archives: params

URL parameters in Javascript

I wanted a piece of code in pure javascript ( no framework required ) that could extract the parameters in the query string part of an URL.

I wanted it to be able to extract the parameters in this format name[key]=value  like they are used in php applications.

I found a piece of code on some other blogs or forum posts but it didn't work as I expected so here is my take on this.

  1. span style="color: #3366CC;">'''&''='

This function one limitation: It doesn't work with multidimensional arrays. It's probably not hard to modify it to work like that but I only needed it to work with single dimension arrays.