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!

location.href 1

Status
Not open for further replies.

jumper2

Programmer
Jul 13, 2007
41
ES
Hi Everybody,

I have a javascript where I need to handling in the location.href as E-Mail address which contains "&" charachter.

Looks like:

location.href = "mailto:user.name@test.com?body=Test&Hier comes still something";

My problem is when I get back the email then the e-mail body is broken by the '&' and therefore I can only see in the body the 'Test' as word.

Could somebody please help me out?
 
Try:
Code:
location.href = escape("mailto:user.name@test.com?body=Test&Hier comes still something");

Lee
 
Just escape the end of string that contains the characters that cause the problems. Look at what the code produced and modify it to get what you need.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top