Welcome to Bucaro TecHelp!

Bucaro TecHelp
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Victims of Sandy Hook

Stop the Slaughter of Innocents. Congress is bought and paid for by gun lunatics and gun promotion groups. If you want to live in a safe America, help buy Congress back for America. Send a donation to Mayors Against Illegal Guns, 909 Third Avenue, 15th Floor New York, NY 10022

JavaScript Character Escape Sequences

Certain characters have programming meaning to the Java Script interpreter, so you may have problems with them when using them in a string. For example a string is enclosed in either single or double quotes. You can't use the same type of quote within the string because when the Java Script interpreter comes upon it, it will think it has reached the end of the string. Another example is if you want to put a new line in a string, you just can't hit the keyboard [Enter] key.

If you need to use one of these characters in a string, you need to substitute it with an "escape sequence". Sometimes escape sequence is called "escape characters". The sequence of characters in an escape sequence informs the Java Script interpreter of how to interpret the characters. Shown below are the most useful escape sequences.

CharacterEscape Sequence
' \'
" \"
\ \\
new line\n
tab \t

Shown below is an example of using escape sequences.

This will not work:

var myString = "The file you seek is in the "toys\games" folder";

The same string with characters substituted with escape sequences:

var myString = "The file you seek is in the \"toys\\games\" folder";

RSS Feed RSS Feed



Follow Stephen Bucaro Follow @Stephen Bucaro


Web Design Sections

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2016 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268