Javascript Reference Guide

 
 
This guide contains useful Javascript tips.






Escape characters.



Information
Escape characters are used inside strings.


Code
SequenceNameExample
\b Backspace  
\f Formfeed  
\n Newline alert("Values:\nAA BB\nCC DD");
\r Carriage return  
\t Horizontal tab alert("One\tTwo");
\'Single quote alert("That\'s it!");
\" Double quote alert("Say \"YES\"");
\\ Backslash alert("Start c:\\test.bat");
\NNN NNN is an octal number that represent the Latin-1 (same as ISO-8859-1) character equivalent. alert("Copyright \251 2004");
\xNN NN is a hexadecimal number that represent the Latin-1 (same as ISO-8859-1) character equivalent. alert("Copyright \xA9 2004");
\uNNNN NNNN is a hexadecimal number that represent the Unicode character equivalent. alert("Copyright \u00AE 2004");