2009-04-10 79 views
0

我使用的是ASP「經典」的服務器,使用JavaScript作爲語言引擎,由指令指定:JScript的「進口」語法ASP經典

<%@LANGUAGE='JAVASCRIPT'%> 

我注意到,'進口」似乎成爲關鍵字。

Technical Information (for support personnel) 

    * Error Type: 
     Microsoft JScript compilation (0x800A03F2) 
     Expected identifier 
     /Default.asp, line 4, column 4 
     var import = 'whut' 
     ---^ 

如果使用了`import'關鍵字?

回答

2

像大多數編程語言,某些關鍵字被保留。 Javascript有點特別,因爲它保留了比在該語言中實現更多的關鍵字。導入就是其中的一個詞。其他的例子是'private'和'void',儘管它們在當前版本中沒有實現。

+0

void實現,雖然不是真正有用的。 – KooiInc 2009-04-10 20:38:37

2

here

The import statement allows a script to import properties, functions and objects exported by a signed script. The following code imports the 'wine' and 'beer' properties of the object 'drinks' provided they have been made available by an exporting script (compare the export statement):

Code: i mport drinks.beer, drinks.wine;

NOTE: Any exported script must be loaded into a window, frame or layer before it can be imported and used.

+0

謝謝,安德魯。我曾嘗試使用這種語法與由出口,但它似乎仍然顯示出語法錯誤: 錯誤類型: Microsoft JScript中的編譯(0x800A03EA) 語法錯誤 /Default.asp,4種線 進口飲料。啤酒,drinks.wine; 我不希望這裏出現語法錯誤。你怎麼看? – 2009-04-10 19:44:41

0

導入是js中的保留字,但我認爲它僅在JScript.NET和ActionScript中實際使用。

0

對JScript的保留字的完整列表(雖然很多都沒有在語言中使用)是:

​​

希望這有助於。