mercoledì, gennaio 21, 2009

Get URL Parameters Using JavaScript

This is really great! I ran across an article on netlobo.com that provides a short JavaScript function that allows one to access query string parameters the way you can in server-side programming.

“Most of the server-side programming languages that I know of like PHP, ASP, or JSP give you easy access to parameters in the query string of a URL. JavaScript does not give you easy access. With JavaScript you must write your own function to parse the window.location.href value to get the query string parameters you want. Here is a small function I wrote that will parse the window.location.href value and return the value for the parameter you specify. It does this using JavaScript’s built in regular expressions.”

2 Comments:

Anonymous Anonimo said...

I inclination not concur on it. I think nice post. Expressly the title attracted me to study the sound story.

1/13/2010 3:47 PM  
Anonymous Anonimo said...

Genial post and this enter helped me alot in my college assignement. Thanks you for your information.

1/17/2010 1:49 PM  

Posta un commento

<< Home