JScript是JavaScript的缩写吗?

信息分类:初级教程 来源:Internet 作者:转载并修改 返回首页

    本文转自台湾一网站,由于两岸计算机术语的差别,在尊重原文的基础上,对个别术语进行了修改。--JsFan

    很多人都误以为JScript就是JavaScript的缩写, 这一点是需要澄清的,让笔者先讲一段故事。

    在网页脚本语言世界中第一个诞生的是,由网景公司(NetScape)所催生的JavaScript。到了1996年11月,ECMA开始根据JavaScript 1.1的规格,着手订定网页脚本语言的标准,这个标准首见于1997年6月所公布的ECMA-262号白皮书。自此而后,所有的浏览器厂商才终于有了一个可以遵循的规格,让JavaScript的市场接受度向前迈了一大步。

    拥有平台优势的Microsoft原本希望能以VBScript与JavaScript在浏览器端一决高下,可惜市场反应并不如预期。还好,老谋深算的Microsoft很快地改变策略,他的策略很是高的-- 「如果不能打败他,就迎向他」。 Microsoft的工程师们在最短的时间内, 根据ECMA-262的标准制定了JScript, 并且让不断推陈出新的浏览器工具持续支持JScript版本的更新。 灵活的市场策略让JScript颇具生命力,也开始取得网页工程师们的喜爱。

    截至目前为止,最新的版本是Jscript.NET。各版本与运行平台的关系如下表所示:

Host Application

1.0

2.0

3.0

4.0

5.0

5.1

5.5

5.6

.NET

  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

    如前所述,既然JavaScript与Jscript都源自于相同的ECMA-262标准,可以想见其中的共同点必定许多。

    在笔者的观察中,从功能面来看,JavaScript可视为Jscript的子集合, 因为Jscript除了包含JavaScript所有的特性与对象之外, 更引进run-time features,包含以下几类:

Category

Feature/Keyword

 Collections

 Drives
 Files
 Folders

 Data Storage

 Dictionary

 Dictionary

 Add
 Exists
 Items, Keys
 Remove, RemoveAll
 Count
 Item, Key

 File System

 Drive
 File
 FileSystemObject
 Folder
 TextStream

 FileSystemObject

 BuildPath
 CopyFile, CopyFolder
 CreateFolder, CreateTextFile
 DeleteFile, DeleteFolder
 DriveExists, FileExists, FolderExists
 GetAbsolutePathName, GetBaseName
 GetDrive, GetDriveName
 GetFile, GetExtensionName GetFileName
 GetFolder, GetParentFolderName
 GetSpecialFolder
 GetTempName
 MoveFile, MoveFolder
 OpenTextFile
 Drives

 Drive, Drives

 AvailableSpace
 Count
 DriveLetter
 DriveType
 FileSystem
 FreeSpace
 IsReady
 Item
 RootFolder
 SerialNumber
 ShareName
 TotalSize
 VolumeName

 File, Files
 Folder, Folders

 Add
 Attributes
 Copy, Delete, Move
 Count
 OpenAsTextStream
 DateCreated, DateLastAccessed,
 DateLastModified
 Drive
 Item
 ParentFolder
 Name, Path
 ShortName, ShortPath
 Size

 TextStream

 Close
 Read, ReadAll, ReadLine
 Skip, SkipLine
 Write, WriteBlankLines, WriteLine
 AtEndOfLine, AtEndOfStream
 Column, Line

    因此,Jscript除了不等于JavaScript之外,它代表的是更为广泛,也更为成熟的脚本语言网页功能。

相关资源