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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailto: and javascript

Status
Not open for further replies.

superfly404

Technical User
Feb 1, 2005
24
US
i'm trying to create a nifty 404 page where a customer can send me an email by clicking a link (mailto) to let me know that the link is broken, however, rather than having them cut and paste the link into the email is there a way to setup some javascript so when the link is clicked it automatically puts the url in the subject line and the body text?

thanks
 
good feedback, but php is not a resource on what i have available, i have to rely on js
 
Try this. You get the best of both worlds - you get an email if they have JS disabled, but with more content if not:

Code:
<a href="mailto:some@address.com?subject=Problem with website" onclick="this.href += escape('&body=The problem was with page: ' + location.href);">

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top