Thursday, September 17, 2009

AccessingQuerystringFromJavascript

I recently came across a situation to access query string from javascript.

Here is the method to access query string keys and values.
Say for this URL http://www.testsite.co.in/?Mode=ADD
the following method,

var queryString = window.location.search.substring(1);

fetches querystring.

Now the variable 'queryString' will have "Mode=ADD".

0 comments: