can someone please help me, i am used to using php on my forms. depending on what method i use whether it is POST or GET i can always get the variable on a submitted form.

but for javascript, how do i get the variable value from the url on the browser.

lets say i have a url that looks like this: http://www.example.com/index.php?user_id=23&name=John

ok, as you can see i have to variables
user_id=23
name=John

with PHP, all i have to do is display the variable using simple code like this:

<?php
echo $_GET['name'];
?>
OUTPUT: John

ok, now how do you do this with javascript?