Reading parameters using js, from a url

R

Randell D.

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.
 
V

VK

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top