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

& in location.href 1

Status
Not open for further replies.

MarkRobinson

Programmer
Feb 18, 2000
112
US
This works on my site:
document.location.href = "mailto:?subject=You'll like this page on HandicappedPets.com&body=It's at: "+ window.document.location.href

Until I get to this page:

which gets processed as:

I assume the & sign in the address is bothering it. Is there a workaround?
 
Yes - escape the string:

Code:
document.location.href = "mailto:?subject=You'll like this page on HandicappedPets.com&body=It's at: " + escape(window.document.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