aspxtreme

JavaScript Basics

Abakada ~ Back to Basics


Special Characters

JavaScript provides special characters that allow you to include in strings some characters you can't type directly. Each of these characters begins with a backslash. The backslash is an escape character you use to inform the JavaScript interpreter that the next character is special.

Escape Sequence Character
\b Backspace
\f Form feed
\n Line feed ( newline )
\r Carriage return
\t Horizontal tab ( Ctrl-I )
\' Single quotation mark
\" Double quotation mark
\\ Backslash

Notice that because the backslash itself is used as the escape character, you cannot directly type one in your script. If you want to write a backslash, you must type two of them together ( \\ ).

aString = "The class of \'97";
aPath = "c:\\myweb\\myhome.aspx";

You can use these escape sequences to control formatting of text inside <PRE> and <XMP> tags and, to some extent, inside alert, prompt, and confirm message boxes.

Some relevant references:

 

Previous: JavaScript Components Next: Programmimg With JavaScript


Books and more ...

Contents
Overview
JavaScript Components
JavaScript Basics
Programmimg With JavaScript
Data Entry Validation
 


Suggested Reading



Back to top

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme