Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get web page url

Status
Not open for further replies.

itechC

Programmer
Feb 13, 2003
71
CA
Hi all and thanks for taking the time to respond. I want to create a function that will get the url of the page the user is visiting. The reason for this is i want to implement a "Tell a friend" button. So the user would be able to click the tell a friend button and get a page with a form and in the form the user will be able to send the url of the specific product. Thanks guys and girls!!
 
Hi

Code:
<a href="#" onclick="alert(document.location);">show me this page</a>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
If you are passing the current page to the form page, you can do so one of two ways:

1. If the form page is opened in a new window by clicking on the page with the needed url, access it through [tt]opener.document.location[/tt], I believe.

2. Pass the URL through the query string. Check out faq216-5442.

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top