加勒比HEZYO黑人专区-久久精品国产99国产精品亚洲-精品国产18久久久久久-久久人妻少妇嫩草AV

歡迎光臨 織晶網絡官網!

  • 服務支持
  • 020-39182790
技術文檔您現在的位置:首頁 > 服務支持 > 技術文檔

JavaScript 保留關鍵詞(keyword)- 全部

作者:織晶客服部   發布于:2020/1/11 15:36:25  點擊量:  來源:織晶網絡

在 JavaScript 中,不能把這些保留詞作為變量、標記或函數名來使用。

用星號標記的關鍵詞是 ECMAScript 5 和ECMAScript 6 中的新詞。

abstract arguments await* 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


被刪除的保留詞

以下保留詞已被從 ECMAScript 5/6 標準中刪除:

abstract boolean byte char
double final float goto
int long native short
synchronized throws transient volatile

請不要將這些保留詞用作變量。并非所有瀏覽器都完全支持 ECMAScript 5/6。


JavaScript 對象、屬性和方法

您還應該避免使用 JavaScript 內建對象的名稱、屬性和方法:

Array Date eval function
hasOwnProperty Infinity isFinite isNaN
isPrototypeOf length Math NaN
name Number Object prototype
String toString undefined valueOf


其他保留詞

JavaScript 能夠在很多應用程序中被用作編程語言。

您還應該避免使用 HTML 和 Window 對象和屬性的名稱:

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


HTML 事件處理程序

此外您應該避免使用所有 HTML 事件處理程序的名稱。

例如:

onblur onclick onerror onfocus
onkeydown onkeypress onkeyup onmouseover
onload onmouseup onmousedown onsubmit




上一篇:打開網頁時出現域名重定向,應該怎么解決?

下一篇:H5視頻播放video的一些問題匯總