var关键字/注释
如果使用var 声明变量 说明变量是局部变量,如果不使用var 声明变量 就是全局变量。不过一定要谨慎使用全局变量,注意全局变量可以多个js文件共享。
注释:
第一种注释://
第二种注释:/* */
第三种注释 //<![CDATA[ xxx内容 // ]]>
当有些浏览器不支持javascript的时候,使用noscript标签
javascript关键字
abstract | arguments | boolean | break | byte |
case | catch | char | class* | const |
continue | debugger | default | delete | do |
double | else | enum* | eval | export* |
extends* | false | final | finally | float |
for | function | goto | if | implements |
import* | in | instanceof | int | interface |
let | long | native | new | null |
package | private | protected | public | return |
short | static | super* | switch | synchronized |
this | throw | throws | transient | true |
try | typeof | var | void | volatile |
while | with | yield |
浏览器关键字:
alert | all | anchor | anchors | area |
assign | blur | button | checkbox | clearInterval |
clearTimeout | clientInformation | close | closed | confirm |
constructor | crypto | decodeURI | decodeURIComponent | defaultStatus |
document | element | elements | embed | embeds |
encodeURI | encodeURIComponent | escape | event | fileUpload |
focus | form | forms | frame | innerHeight |
innerWidth | layer | layers | link | location |
mimeTypes | navigate | navigator | frames | frameRate |
hidden | history | image | images | offscreenBuffering |
open | opener | option | outerHeight | outerWidth |
packages | pageXOffset | pageYOffset | parent | parseFloat |
parseInt | password | pkcs11 | plugin | prompt |
propertyIsEnum | radio | reset | screenX | screenY |
scroll | secure | select | self | setInterval |
setTimeout | status | submit | taint | text |
textarea | top | unescape | untaint | window |
JavaScript 对象、属性和方法
Array | Date | eval | function | hasOwnProperty |
Infinity | isFinite | isNaN | isPrototypeOf | length |
Math | NaN | name | Number | Object |
prototype | String | toString | undefined | valueOf |
表格来源:http://www.runoob.com/js/js-reserved.html