Javascript reserved keywords and dangerous variable names

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.