PDA

View Full Version : Is there a way to generate info from the Address Bar?


Bomu
06-25-2002, 06:42 PM
For a web page I'm making, I need to be able to generate the browser's www. address into a page's content.

For example;
Content on page reads:

www.newdomain.com has been resistered with us for one of our
clients.

www.newdomain.com - should be generated from the address bar URL.
Is it possible to do this?

cheers

landon11
06-25-2002, 07:00 PM
var w = window.location.href
alert(w);

jkd
06-25-2002, 09:57 PM
If you want the whole address printed out:

document.write(window.location.href);

If you only want the domain written out (i.e. www.codingforums.com regardless of where you are on the site):

document.write(document.domain);

:)

Bomu
06-26-2002, 11:04 AM
Thanks a lot guys! I think, document.write(window.location.href); Is just what I need! I'd better go test it first :)