...

View Full Version : Read URL of the page



Jesper Møller
06-24-2006, 02:32 AM
A small simpel question (i think)

How do i get a Javascript to read the URL of the page its is on :rolleyes:

boxxer03
06-24-2006, 03:31 AM
document.URL will return the url of the page.

Jesper Møller
06-24-2006, 10:27 AM
Thank you :thumbsup:

_Aerospace_Eng_
06-24-2006, 10:29 AM
Hmm which would be better to use? location.href or document.URL?

Jesper Møller
06-24-2006, 10:34 AM
Ill try both :)

boxxer03
06-27-2006, 05:22 AM
I'm not sure. Wether you use document.URL or location.href they'll both return the same thing. I know that document.URL returns the URL, but location.href can return or set the whole url.

Jesper Møller
06-27-2006, 05:28 AM
I used this :thumbsup:

texta.href=window.location.href+"?detect=false";

boxxer03
06-28-2006, 02:33 AM
if that does what you need it to and works fine then stick with it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum