Click to See Complete Forum and Search --> : How do I use Javascript to read the url?


chestertb
04-17-2004, 07:35 AM
Hi all,

First, let me apologise for asking this again... I had a solution, but stupidly trashed the folder it was in, and now can't find it on any of the dozen or so backups I keep.

I have a web hosting service that allows me to "park" a domain.

If a user types http://www.realdomain.com in his browser, he gets there. If he types http://www.someotherdomain.com he gets there too.

Javascript has a function that will read the domain name from the browser, allowing me to write a tiny script redirecting to a welcome page according to the domain name typed.

Does anyone know what that function is?

Thanks
CTB

Khalid Ali
04-17-2004, 08:00 AM
location.href

will give you the complete url(this is the urlof thepage that has been loaded in the window)

chestertb
04-17-2004, 08:04 AM
Thanks Khalid.

Much appreciate the assistance. I'll try not to lose it this time.
CTB

Khalid Ali
04-17-2004, 08:14 AM
you are welocme...:D
In case you lose it again you will find this forum rght here,,