PDA

View Full Version : special characters in javascript alert...?


andehlu
07-17-2005, 08:14 PM
Does anyone know how to put special characters in a javascript alert?

Im trying to make a french js alert....
alert("Veuillez inscrire votre prénom..")

thanks for the help.....

irimi
07-19-2005, 01:46 PM
To do this I use the escape() function in Flash. It escapes every special character.

You must escape the ' (single quote) character too, as this character is used in the getURL() syntax when calling javascript functions like alert(). You must add 2 backslashes before every ' to escape them. If you add only one it will not work.

I have problems anyway to display every special char. In Mozilla it works, but in IE the accent letters don't work. I think it's due to the encoding : Flash uses UTF8 and Javascript uses UTF16. If someone know how to solve this ?