Connecting Tech Pros Worldwide Help | Site Map

Reading parameters using js, from a url

Randell D.
Guest
 
Posts: n/a
#1: Jul 23 '05

Folks,

Can someone give me some pointers on how I can read one or more
arguements from a url, using js?

Why? I'm working on a LAMP based project and when a user successfully
registers, the header redirects to the login screen - I'd like to check
for the value of register, if read from:

http://www.mydomain.com/index.html?register=success

A pointer/hint as opposed to a solution should be sufficient because I'm
doing pretty well learning javascript.

Much appreciated,
Thanks,
Randell D.
VK
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Reading parameters using js, from a url


Use window.location.href properties, especially
window.location.href.search may be useful.

String's method split() (by "&" first, then by "=") will finish the job.

Closed Thread