Get URL Variables


/ Published in: JavaScript
Save to your folder(s)

Read a page's GET URL variables and return them as an associative array.

----

Example for URL http://www.example.com/index.html?hello=bonjour&goodevening=bonsoir

var hash = getUrlVars();
alert(hash['hello']); // prints 'bonjour'
alert(hash['goodevening']); // prints 'bonsoir'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.