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

special characters in javascript

Status
Not open for further replies.

nonito

Technical User
Jun 3, 2008
2
ES
I have a webpage with photos and when you select some photos, you can click a link and an email is generated with the number of the photos.
In this javascript file I would like to add special characters (like é or ñ), but this is not accepted.

1 if (c==0) {
2 bodytxt="Seleccionar ……";
3 for (j=1;j<=num_maillinks;j++) {
4 el="maillink" + j;
5 document.getElementById(el).innerHTML=bodytxt;
6 }
7 } else {
8 if (c==1) {
9 msg="(Anada …:)" + "\n\n" + "Hay " + c + " foto mirado.\n\n";
10 ni='para mirar esta foto';
11 } else {
12 msg="(Anada …:)" + "\n\n" + "Hay " + c + " fotos mirados.\n\n";
13 ni='para nirar estas ' + c + ' fotos'
14 }
15 bodytxt=msg + txt + "\n"+ "Fecha mirado: " + now + "\n" + actie + "\n\n";
16 bodytxt=escape(bodytxt);

line 2 is text on the webpage and here a special character is accepted

line 9-16 is the output for the email message. When I change in line 9 Anade for A&ntilde;ade (Añade), then there is no more text after A.
What is the trick to add special characters in javascript?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top