JScript 版本資訊

更新:2007 年 11 月

JScript 是持續演化的語言,而且語言的每個新版本都會導入新功能。若要發揮特殊語言版提供的所有功能,就需要編譯器或指令碼引擎的相容版本。

版本和主應用程式

為伺服器端的應用程式或命令列程式撰寫程式碼時,通常要知道編譯器版本和它支援的 JScript 版本。但是,撰寫在瀏覽器的指令碼引擎中執行的用戶端指令碼時,執行的指令碼會偵測出引擎版本。知道引擎版本後,就可以執行在 JScript 相容版本撰寫的指令碼。如需詳細資訊,請參閱偵測瀏覽器功能

以下表格列出由主應用程式 (Host Application) 實作的 Microsoft JScript 版本。

主應用程式

1.0

2.0

3.0

4.0

5.0

5.1

5.5

5.6

.NET

8.0

Microsoft Internet Explorer 3.0

x

 

 

 

 

 

 

 

 

 

Microsoft Internet Information Server 3.0

 

x

 

 

 

 

 

 

 

 

Microsoft Internet Explorer 4.0

 

 

x

 

 

 

 

 

 

 

Microsoft Internet Information Server 4.0

 

 

x

 

 

 

 

 

 

 

Microsoft Internet Explorer 5.0

 

 

 

 

x

 

 

 

 

 

Microsoft Internet Explorer 5.01

 

 

 

 

 

x

 

 

 

 

Microsoft Windows 2000

 

 

 

 

 

x

 

 

 

 

Microsoft Internet Explorer 5.5

 

 

 

 

 

 

x

 

 

 

Microsoft Windows Millennium Edition

 

 

 

 

 

 

x

 

 

 

Microsoft Internet Explorer 6.0

 

 

 

 

 

 

 

x

 

 

Microsoft Windows XP

 

 

 

 

 

 

 

x

 

 

Microsoft Windows Server 2003

 

 

 

 

 

 

 

x

 

 

Microsoft .NET Framework 1.0

 

 

 

 

 

 

 

 

x

 

注意事項:

ScriptEngineMajorVersion 函式和 @_jscript_version 條件式編譯變數報告的版本號碼一定是數值。這樣才能用版本號碼作數值比較。所報告的.NET 應用程式版本是 7.x,不是 .NET。這表示報告版本號碼為 7.x (含) 以上版本的引擎,可編譯 JScript 8.0 程式碼。

以下表格列出 JScript 語言功能,以及首次引入的版本。

語言項目

1.0

2.0

3.0

4.0

5.0

5.5

.NET

8.0

0...n 屬性

 

 

 

 

 

x

 

 

$1...$9 屬性

 

 

x

 

 

 

 

 

abs 方法

x

 

 

 

 

 

 

 

abstract 修飾詞

 

 

 

 

 

 

x

 

acos 方法

x

 

 

 

 

 

 

 

ActiveXObject 物件

 

 

x

 

 

 

 

 

加法運算子 (+)

x

 

 

 

 

 

 

 

加法指派運算子 (+=)

x

 

 

 

 

 

 

 

anchor 方法

x

 

 

 

 

 

 

 

apply 方法

 

 

 

 

 

x

 

 

arguments 物件

x

 

 

 

 

 

 

 

arguments 屬性

 

x

 

 

 

 

 

 

Array 物件

 

x

 

 

 

 

 

 

asin 方法

x

 

 

 

 

 

 

 

指派運算子 (=)

x

 

 

 

 

 

 

 

atan 方法

x

 

 

 

 

 

 

 

atan2 方法

x

 

 

 

 

 

 

 

atEnd 方法

 

 

x

 

 

 

 

 

big 方法

x

 

 

 

 

 

 

 

位元 AND 運算子 (&)

x

 

 

 

 

 

 

 

位元 AND 指派運算子 (&=)

x

 

 

 

 

 

 

 

位元左移運算子 (<<)

x

 

 

 

 

 

 

 

位元 NOT 運算子 (~)

x

 

 

 

 

 

 

 

位元 OR 運算子 (|)

x

 

 

 

 

 

 

 

位元 OR 指派運算子 (|=)

x

 

 

 

 

 

 

 

位元右移運算子 (>>)

x

 

 

 

 

 

 

 

位元 XOR 運算子 (^)

x

 

 

 

 

 

 

 

位元 XOR 指派運算子 (^=)

x

 

 

 

 

 

 

 

blink 方法

x

 

 

 

 

 

 

 

bold 方法

x

 

 

 

 

 

 

 

boolean 資料型別

 

 

 

 

 

 

x

 

Boolean 物件

 

x

 

 

 

 

 

 

break 陳述式

x

 

 

 

 

 

 

 

byte 資料型別

 

 

 

 

 

 

x

 

call 方法

 

 

 

 

 

x

 

 

callee 屬性

 

 

 

 

 

x

 

 

caller 屬性

 

x

 

 

 

 

 

 

catch 陳述式

 

 

 

 

x

 

 

 

@cc_on 陳述式

 

 

x

 

 

 

 

 

ceil 方法

x

 

 

 

 

 

 

 

char 資料型別

 

 

 

 

 

 

x

 

charAt 方法

x

 

 

 

 

 

 

 

charCodeAt 方法

 

 

 

 

 

x

 

 

class 陳述式

 

 

 

 

 

 

x

 

逗號運算子 (,)

x

 

 

 

 

 

 

 

// (單行註解陳述式)

x

 

 

 

 

 

 

 

/*..*/ (多行註解陳述式)

x

 

 

 

 

 

 

 

比較運算子

x

 

 

 

 

 

 

 

compile 方法

 

 

x

 

 

 

 

 

concat 方法 (陣列)

 

 

x

 

 

 

 

 

concat 方法 (字串)

 

 

x

 

 

 

 

 

條件式編譯

 

 

x

 

 

 

 

 

條件式編譯變數

 

 

x

 

 

 

 

 

條件 (三元) 運算子 (?:)

x

 

 

 

 

 

 

 

const 陳述式

 

 

 

 

 

 

x

 

constructor 屬性

 

x

 

 

 

 

 

 

continue 陳述式

x

 

 

 

 

 

 

 

cos 方法

x

 

 

 

 

 

 

 

資料型別轉換

 

 

x

 

 

 

 

 

Date 物件

x

 

 

 

 

 

 

 

@debug 指示詞

 

 

 

 

 

 

x

 

debugger 陳述式

 

 

x

 

 

 

 

 

decimal 資料型別

 

 

 

 

 

 

x

 

decodeURI 方法

 

 

 

 

 

x

 

 

decodeURIComponent 方法

 

 

 

 

 

x

 

 

遞減運算子 (--)

x

 

 

 

 

 

 

 

delete 運算子

 

 

x

 

 

 

 

 

description 屬性

 

 

 

 

x

 

 

 

dimensions 方法

 

 

x

 

 

 

 

 

除法運算子 (/)

x

 

 

 

 

 

 

 

除法指派運算子 (/=)

x

 

 

 

 

 

 

 

do...while 陳述式

 

 

x

 

 

 

 

 

double 資料型別

 

 

 

 

 

 

x

 

E 屬性

x

 

 

 

 

 

 

 

encodeURI 方法

 

 

 

 

 

x

 

 

encodeURIComponent 方法

 

 

 

 

 

x

 

 

enum 陳述式

 

 

 

 

 

 

x

 

Enumerator 物件

 

 

x

 

 

 

 

 

等號比較運算子 (==)

x

 

 

 

 

 

 

 

Error 物件

 

 

 

 

x

 

 

 

escape 方法

x

 

 

 

 

 

 

 

eval 方法

x

 

 

 

 

 

 

 

exec 方法

 

 

x

 

 

 

 

 

exp 方法

x

 

 

 

 

 

 

 

expando 修飾詞

 

 

 

 

 

 

x

 

false 常值

x

 

 

 

 

 

 

 

final 修飾詞

 

 

 

 

 

 

x

 

fixed 方法

x

 

 

 

 

 

 

 

float 資料型別

 

 

 

 

 

 

x

 

floor 方法

x

 

 

 

 

 

 

 

fontcolor 方法

x

 

 

 

 

 

 

 

fontsize 方法

x

 

 

 

 

 

 

 

for 陳述式

x

 

 

 

 

 

 

 

for...in 陳述式

 

 

 

 

x

 

 

 

fromCharCode 方法

 

 

x

 

 

 

 

 

function get 陳述式

 

 

 

 

 

 

x

 

Function 物件

 

x

 

 

 

 

 

 

function set 陳述式

 

 

 

 

 

 

x

 

function 陳述式

x

 

 

 

 

 

 

 

getDate 方法

x

 

 

 

 

 

 

 

getDay 方法

x

 

 

 

 

 

 

 

getFullYear 方法

 

 

x

 

 

 

 

 

getHours 方法

x

 

 

 

 

 

 

 

getItem 方法

 

 

x

 

 

 

 

 

getMilliseconds 方法

 

 

x

 

 

 

 

 

getMinutes 方法

x

 

 

 

 

 

 

 

getMonth 方法

x

 

 

 

 

 

 

 

GetObject 函式

 

 

x

 

 

 

 

 

getSeconds 方法

x

 

 

 

 

 

 

 

getTime 方法

x

 

 

 

 

 

 

 

getTimezoneOffset 方法

x

 

 

 

 

 

 

 

getUTCDate 方法

 

 

x

 

 

 

 

 

getUTCDay 方法

 

 

x

 

 

 

 

 

getUTCFullYear 方法

 

 

x

 

 

 

 

 

getUTCHours 方法

 

 

x

 

 

 

 

 

getUTCMilliseconds 方法

 

 

x

 

 

 

 

 

getUTCMinutes 方法

 

 

x

 

 

 

 

 

getUTCMonth 方法

 

 

x

 

 

 

 

 

getUTCSeconds 方法

 

 

x

 

 

 

 

 

getVarDate 方法

 

 

x

 

 

 

 

 

getYear 方法

x

 

 

 

 

 

 

 

Global 物件

 

 

x

 

 

 

 

 

global 屬性

 

 

 

 

 

x

 

 

大於運算子 (>)

x

 

 

 

 

 

 

 

大於或等於運算子 (>=)

x

 

 

 

 

 

 

 

hasOwnProperty 方法

 

 

 

 

 

x

 

 

hide 修飾詞

 

 

 

 

 

 

x

 

@if 陳述式

 

 

x

 

 

 

 

 

if...else 陳述式

x

 

 

 

 

 

 

 

ignoreCase 屬性

 

 

 

 

 

x

 

 

import 陳述式

 

 

 

 

 

 

x

 

in 運算子

x

 

 

 

 

 

 

 

遞增運算子 (++)

x

 

 

 

 

 

 

 

index 屬性

 

 

x

 

 

 

 

 

indexOf 方法

x

 

 

 

 

 

 

 

不等比較運算子 (!=)

x

 

 

 

 

 

 

 

Infinity 屬性

 

 

x

 

 

 

 

 

input 屬性 ($_)

 

 

x

 

 

 

 

 

instanceof 運算子

 

 

 

 

x

 

 

 

int 資料型別

 

 

 

 

 

 

x

 

interface 陳述式

 

 

 

 

 

 

x

 

internal 修飾詞

 

 

 

 

 

 

x

 

isFinite 方法

 

 

x

 

 

 

 

 

isNaN 方法

x

 

 

 

 

 

 

 

isPrototypeOf 方法

 

 

 

 

 

x

 

 

italics 方法

x

 

 

 

 

 

 

 

item 方法

 

 

x

 

 

 

 

 

JScript 資料型別

 

 

 

 

 

 

x

 

join 方法

 

x

 

 

 

 

 

 

標記陳述式

 

 

x

 

 

 

 

 

lastIndex 屬性

 

 

x

 

 

 

 

 

lastIndexOf 方法

x

 

 

 

 

 

 

 

lastMatch 屬性 ($&)

 

 

 

 

 

x

 

 

lastParen 屬性 ($+)

 

 

 

 

 

x

 

 

lbound 方法

 

 

x

 

 

 

 

 

leftContext 屬性 ($`)

 

 

 

 

 

x

 

 

左移指派運算子 (<<=)

x

 

 

 

 

 

 

 

length 屬性 (引數)

 

 

 

 

 

x

 

 

length 屬性 (陣列)

 

x

 

 

 

 

 

 

length 屬性 (函式)

 

x

 

 

 

 

 

 

length 屬性 (字串)

x

 

 

 

 

 

 

 

小於運算子 (<)

x

 

 

 

 

 

 

 

小於或等於運算子 (<=)

x

 

 

 

 

 

 

 

link 方法

x

 

 

 

 

 

 

 

LN2 屬性

x

 

 

 

 

 

 

 

LN10 屬性

x

 

 

 

 

 

 

 

localeCompare 方法

 

 

 

 

 

x

 

 

log 方法

x

 

 

 

 

 

 

 

LOG2E 屬性

x

 

 

 

 

 

 

 

LOG10E 屬性

x

 

 

 

 

 

 

 

邏輯 AND 運算子 (&&)

x

 

 

 

 

 

 

 

邏輯 NOT 運算子 (!)

x

 

 

 

 

 

 

 

邏輯 OR 運算子 (||)

x

 

 

 

 

 

 

 

long 資料型別

 

 

 

 

 

 

x

 

match 方法

 

 

x

 

 

 

 

 

Math 物件

x

 

 

 

 

 

 

 

max 方法

x

 

 

 

 

 

 

 

MAX_VALUE 屬性

 

x

 

 

 

 

 

 

message 屬性

 

 

 

 

 

x

 

 

min 方法

x

 

 

 

 

 

 

 

MIN_VALUE 屬性

 

x

 

 

 

 

 

 

模數運算子 (%)

x

 

 

 

 

 

 

 

模數指派運算子 (%=)

x

 

 

 

 

 

 

 

moveFirst 方法

 

 

x

 

 

 

 

 

moveNext 方法

 

 

x

 

 

 

 

 

multiline 屬性

 

 

 

 

 

x

 

 

乘法運算子 (*)

x

 

 

 

 

 

 

 

乘法指派運算子 (*=)

x

 

 

 

 

 

 

 

name 屬性

 

 

 

 

 

x

 

 

NaN 屬性 (全域)

 

 

x

 

 

 

 

 

NaN 屬性 (數字)

 

x

 

 

 

 

 

 

NEGATIVE_INFINITY 屬性

 

x

 

 

 

 

 

 

new 運算子

x

 

 

 

 

 

 

 

非識別運算子 (!==)

x

 

 

 

 

 

 

 

null 常值

x

 

 

 

 

 

 

 

Number 資料型別

 

 

 

 

 

 

x

 

Number 物件

 

x

 

 

 

 

 

 

number 屬性

 

 

 

 

x

 

 

 

Object 物件

 

 

x

 

 

 

 

 

運算子優先順序

x

 

 

 

 

 

 

 

override 修飾詞

 

 

 

 

 

 

x

 

package 陳述式

 

 

 

 

 

 

x

 

parse 方法

x

 

 

 

 

 

 

 

parseFloat 方法

x

 

 

 

 

 

 

 

parseInt 方法

x

 

 

 

 

 

 

 

PI 屬性

x

 

 

 

 

 

 

 

pop 方法

 

 

 

 

 

x

 

 

@position 指示詞

 

 

 

 

 

 

x

 

POSITIVE_INFINITY 屬性

 

x

 

 

 

 

 

 

pow 方法

x

 

 

 

 

 

 

 

print 陳述式

 

 

 

 

 

 

x

 

private 修飾詞

 

 

 

 

 

 

x

 

propertyIsEnumerable 屬性

 

 

 

 

 

x

 

 

protected 修飾詞

 

 

 

 

 

 

x

 

prototype 屬性

 

x

 

 

 

 

 

 

public 修飾詞

 

 

 

 

 

 

x

 

push 方法

 

 

 

 

 

x

 

 

random 方法

x

 

 

 

 

 

 

 

RegExp 物件

 

 

x

 

 

 

 

 

規則運算式物件

 

 

x

 

 

 

 

 

規則運算式語法

 

 

x

 

 

 

 

 

replace 方法

x

 

 

 

 

 

 

 

return 陳述式

x

 

 

 

 

 

 

 

reverse 方法

 

x

 

 

 

 

 

 

rightContext 屬性 ($')

 

 

 

 

 

x

 

 

右移指派運算子 (>>=)

x

 

 

 

 

 

 

 

round 方法

x

 

 

 

 

 

 

 

sbyte 資料型別

 

 

 

 

 

 

x

 

ScriptEngine 函式

 

x

 

 

 

 

 

 

ScriptEngineBuildVersion 函式

 

x

 

 

 

 

 

 

ScriptEngineMajorVersion 函式

 

x

 

 

 

 

 

 

ScriptEngineMinorVersion 函式

 

x

 

 

 

 

 

 

search 方法

 

 

x

 

 

 

 

 

@set 陳述式

 

 

x

 

 

 

 

 

setDate 方法

x

 

 

 

 

 

 

 

setFullYear 方法

 

 

x

 

 

 

 

 

setHours 方法

x

 

 

 

 

 

 

 

setMilliseconds 方法

 

 

x

 

 

 

 

 

setMinutes 方法

x

 

 

 

 

 

 

 

setMonth 方法

x

 

 

 

 

 

 

 

setSeconds 方法

x

 

 

 

 

 

 

 

setTime 方法

x

 

 

 

 

 

 

 

setUTCDate 方法

 

 

x

 

 

 

 

 

setUTCFullYear 方法

 

 

x

 

 

 

 

 

setUTCHours 方法

 

 

x

 

 

 

 

 

setUTCMilliseconds 方法

 

 

x

 

 

 

 

 

setUTCMinutes 方法

 

 

x

 

 

 

 

 

setUTCMonth 方法

 

 

x

 

 

 

 

 

setUTCSeconds 方法

 

 

x

 

 

 

 

 

setYear 方法

x

 

 

 

 

 

 

 

shift 方法

 

 

 

 

 

x

 

 

short 資料型別

 

 

 

 

 

 

x

 

sin 方法

x

 

 

 

 

 

 

 

slice 方法 (陣列)

 

 

x

 

 

 

 

 

slice 方法 (字串)

 

 

x

 

 

 

 

 

small 方法

x

 

 

 

 

 

 

 

sort 方法

 

x

 

 

 

 

 

 

source 屬性

 

 

x

 

 

 

 

 

splice 方法

 

 

 

 

 

x

 

 

split 方法

 

 

x

 

 

 

 

 

sqrt 方法

x

 

 

 

 

 

 

 

SQRT1_2 屬性

x

 

 

 

 

 

 

 

SQRT2 屬性

x

 

 

 

 

 

 

 

static 修飾詞

 

 

 

 

 

 

x

 

static 陳述式

 

 

 

 

 

 

x

 

絕對等號比較運算子 (===)

x

 

 

 

 

 

 

 

strike 方法

x

 

 

 

 

 

 

 

String 資料型別

 

 

 

 

 

 

x

 

String 物件

x

 

 

 

 

 

 

 

sub 方法

x

 

 

 

 

 

 

 

substr 方法

 

 

x

 

 

 

 

 

substring 方法

x

 

 

 

 

 

 

 

減法運算子 (-)

x

 

 

 

 

 

 

 

減法指派運算子 (-=)

x

 

 

 

 

 

 

 

sup 方法

x

 

 

 

 

 

 

 

super 陳述式

 

 

 

 

 

 

x

 

switch 陳述式

 

 

x

 

 

 

 

 

tan 方法

x

 

 

 

 

 

 

 

test 方法

 

 

x

 

 

 

 

 

this 陳述式

x

 

 

 

 

 

 

 

throw 陳述式

 

 

 

 

x

 

 

 

toArray 方法

 

 

x

 

 

 

 

 

toDateString 方法

 

 

 

 

 

x

 

 

toExponential 方法

 

 

 

 

 

x

 

 

toFixed 方法

 

 

 

 

 

x

 

 

toGMTString 方法

x

 

 

 

 

 

 

 

toLocaleDateString 方法

 

 

 

 

 

x

 

 

toLocaleLowerCase 方法

 

 

 

 

 

x

 

 

toLocaleString 方法

x

 

 

 

 

 

 

 

toLocaleTimeString 方法

 

 

 

 

 

x

 

 

toLocaleUpperCase 方法

 

 

 

 

 

x

 

 

toLowerCase 方法

x

 

 

 

 

 

 

 

toPrecision 方法

 

 

 

 

 

x

 

 

toString 方法

 

x

 

 

 

 

 

 

toTimeString 方法

 

 

 

 

 

x

 

 

toUpperCase 方法

x

 

 

 

 

 

 

 

toUTCString 方法

 

 

x

 

 

 

 

 

true 常值

x

 

 

 

 

 

 

 

try...catch...finally 陳述式

 

 

 

 

x

 

 

 

型別附註

 

 

 

 

 

 

x

 

型別轉換

 

 

 

 

 

 

x

 

typeof 運算子

x

 

 

 

 

 

 

 

ubound 方法

 

 

x

 

 

 

 

 

uint 資料型別

 

 

 

 

 

 

x

 

ulong 資料型別

 

 

 

 

 

 

x

 

一元負運算子 (-)

x

 

 

 

 

 

 

 

undefined 屬性

 

 

 

 

 

x

 

 

unescape 方法

x

 

 

 

 

 

 

 

unshift 方法

 

 

 

 

 

x

 

 

不帶正負號的右移運算子 (>>>)

x

 

 

 

 

 

 

 

不帶正負號的右移指派運算子 (>>>=)

x

 

 

 

 

 

 

 

ushort 資料型別

 

 

 

 

 

 

x

 

UTC 方法

x

 

 

 

 

 

 

 

valueOf 方法

 

x

 

 

 

 

 

 

var 陳述式

x

 

 

 

 

 

 

 

VBArray 物件

 

 

x

 

 

 

 

 

void 運算子

 

x

 

 

 

 

 

 

while 陳述式

x

 

 

 

 

 

 

 

with 陳述式

x

 

 

 

 

 

 

 

請參閱

概念

JScript 8.0 的新功能

其他資源

JScript 參考