Click to See Complete Forum and Search --> : diaplaying the web URL


aquanaut
11-02-2003, 10:43 AM
Hi - I'm newish to java scripts and I have been looking for a method of displaying the web URL on a series of web pages

I use the same pages on a few different websites and instead of manually editing them to display the web url each time I wonder if the 'www.mydomain.com' can be extracted and displayed.

I suspect its dead simple - sorry to be a pain

Regards
Jerry

AdamGundry
11-02-2003, 02:12 PM
Yes, you can use the Location object:

document.write(window.location.host);

Adam

aquanaut
11-02-2003, 03:26 PM
Thats so cool and easy - Thanks again.

Regards
Jerry

AdamGundry
11-03-2003, 09:52 AM
No problem. :cool:

Adam