Javascript reserved keywords and dangerous variable names define variable names with caution
In the development process, use as few words as possible as the variable name or attribute name. The keywords are strictly not allowed, when using the variable or class name defined by the browser, ensure the scope.
I. NowEmcascriptKeyword in:
Break |
Case |
Catch |
Continue |
Default |
Delete |
Do |
Else |
Finally |
For |
Function |
If |
In |
Instanceof |
New |
Return |
Switch |
This |
Throw |
Try |
Typeof |
VaR |
Void |
While |
With |
|
|
|
Ii. FutureEmcascript 5Keywords that may be used in:
Abstract |
Boolean |
Byte |
Char |
Class |
Debugger |
Double |
Enum |
Extends |
Final |
Float |
Goto |
Implements |
Int |
Interface |
Long |
Native |
Package |
Private |
Protected |
Public |
Short |
Static |
Super |
Synchronized |
Throws |
Transient |
Volatile |
III,Javascript2.0 (future)Keyword not explicitly mentioned:
As |
Const |
Export |
Import |
Is |
Use |
|
|
IV,Pre-defined in most browsersSome variable names and class names:
Anchor |
Anchors |
Applet |
Applets |
Area |
Array |
Body |
Button |
Checkbox |
Date |
Document |
Error |
Evalerror |
Fileupload |
Form |
Forms |
Frame |
Frames |
Function |
Hidden |
History |
History |
Image |
Images |
Link |
Links |
Location |
Math |
Mimetype |
Mimetypes |
Navigator |
Number |
Object |
Option |
Options |
Password |
Plugin |
Plugins |
Radio |
Rangeerror |
Referenceerror |
Regexp |
Reset |
Screen |
Script |
Select |
String |
Style |
Stylesheet |
Submit |
Syntaxerror |
Text |
Textarea |
Typeerror |
Urierror |
Window |
5. Global attributes and methods:
Infinity |
Nan |
Undefined |
Decodeuri |
Decodeuricomponent |
Encodeuri |
Encodeuricomponent |
Escape |
Eval |
Isfinite |
Isnan |
Parsefloat |
Parseint |
Unescape |
|
|
6. properties and methods of the window object:
1. Property:
Closed |
Components |
Content |
Controllers |
Defaultstatus |
Directories |
Document |
Frames |
History |
Innerheight |
Innerwidth |
Length |
Location |
Locationbar |
Menubar |
Name |
Navigator |
Opener |
Outerheight |
Outerwidth |
Pagexoffset |
Pageyoffset |
Parent |
Personalbar |
Pkcs11 |
Prompter |
Screen |
Screenx |
Screeny |
Scrollbars |
Scrollx |
Scrolly |
Self |
Statusbar |
Toolbar |
Top |
Window |
|
|
|
2. Methods:
alert |
back |
blur |
captureevents |
clearinterval |
cleartimeout |
close |
confirm |
dump |
escape |
focus |
forward |
getattention |
getselection |
Home |
moveBy |
moveTo |
open |
Print |
prompt |
releaseevents |
resizeBy |
resizeTo |
scroll |
scrollby |
scrollbylines |
scrollbypages |
scrollto |
setcursor |
setinterval |
setTimeout |
sizetocontents |
stop |
Unescape |
updatecommands |
|
VII. Events:
Onabort |
Onblur |
Onchange |
Onclick |
Onclose |
Ondragdrop |
Onerror |
Onfocus |
Onkeydown |
Onkeypress |
Onkeyup |
Onload |
Onmousedown |
Onmousemove |
Onmouseout |
Onmouseover |
Onmouseup |
Onpaint |
Onreset |
Onresize |
Onscroll |
Onselect |
Onsubmit |
OnUnload |
8. pre-defined variable names and class names in a specific Browser:
All |
Assign |
Clientinformation |
Element |
Embed |
Embeds |
Event |
Framerate |
Getclass |
Java |
Javaarray |
Javaclass |
Javaobject |
Javapackage |
Layer |
Layers |
Netscape |
Offscreenbuffering |
Opener |
Packages |
Secure |
Status |
Sun |
Taint |
Tosource |
Tostring |
Untaint |
Valueof |
Address: http://www.qianduanzu.com/2012033020.html