ASP经典的JScript'import'语法

时间:2021-02-01 01:39:30

I'm using an ASP "classic" server, with JavaScript as the language engine, specified by the directive:

我正在使用ASP“经典”服务器,使用JavaScript作为语言引擎,由指令指定:

<%@LANGUAGE='JAVASCRIPT'%>

I've noticed that `import' seems to be a keyword.

我注意到`import'似乎是一个关键字。

Technical Information (for support personnel)

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

How is the `import' keyword used, if at all?

如果有的话,如何使用`import'关键字?

4 个解决方案

#1


Like in most programming languages, certain keywords are reserved. Javascript is a bit special since it reserves more keywords than are implemented in the language. Import is one of those words. Other examples are 'private' and 'void', though they are not implemented in the current releases.

与大多数编程语言一样,某些关键字是保留的。 Javascript有点特殊,因为它保留了比在语言中实现的关键字更多的关键字。导入就是其中一个词。其他示例是“私有”和“无效”,但它们未在当前版本中实现。

#2


From 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):

import语句允许脚本导入由签名脚本导出的属性,函数和对象。以下代码导入对象'drink'的'wine'和'beer'属性,前提是它们已由导出脚本提供(比较导出语句):

Code: import drinks.beer, drinks.wine;

代码:import drinks.beer,drinks.wine;

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

注意:必须先将任何导出的脚本加载到窗口,框架或图层中,然后才能导入和使用它们。

#3


import is a reserved word in js, but I think it is only actually used in JScript.NET and ActionScript.

import是js中的保留字,但我认为它实际上只在JScript.NET和ActionScript中使用。

#4


The full list of reserved words for JScript (although many are not used in the language) are:

JScript保留字的完整列表(尽管许多未在该语言中使用)是:

abstract, boolean, break, byte, case, catch, char, class, const, continue, debugger,
default, delete, do, double, else, enum, export, extends, false, final, finally,
float, for, function, goto, if, implements, import, in, instanceof, int, interface,
long, native, new, null, package, private, protected, public, return, short, static,
super, switch, synchronized, this, throw, throws, transient, true, try, typeof, var,
volatile, void, while, with

Hope this helps.

希望这可以帮助。

#1


Like in most programming languages, certain keywords are reserved. Javascript is a bit special since it reserves more keywords than are implemented in the language. Import is one of those words. Other examples are 'private' and 'void', though they are not implemented in the current releases.

与大多数编程语言一样,某些关键字是保留的。 Javascript有点特殊,因为它保留了比在语言中实现的关键字更多的关键字。导入就是其中一个词。其他示例是“私有”和“无效”,但它们未在当前版本中实现。

#2


From 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):

import语句允许脚本导入由签名脚本导出的属性,函数和对象。以下代码导入对象'drink'的'wine'和'beer'属性,前提是它们已由导出脚本提供(比较导出语句):

Code: import drinks.beer, drinks.wine;

代码:import drinks.beer,drinks.wine;

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

注意:必须先将任何导出的脚本加载到窗口,框架或图层中,然后才能导入和使用它们。

#3


import is a reserved word in js, but I think it is only actually used in JScript.NET and ActionScript.

import是js中的保留字,但我认为它实际上只在JScript.NET和ActionScript中使用。

#4


The full list of reserved words for JScript (although many are not used in the language) are:

JScript保留字的完整列表(尽管许多未在该语言中使用)是:

abstract, boolean, break, byte, case, catch, char, class, const, continue, debugger,
default, delete, do, double, else, enum, export, extends, false, final, finally,
float, for, function, goto, if, implements, import, in, instanceof, int, interface,
long, native, new, null, package, private, protected, public, return, short, static,
super, switch, synchronized, this, throw, throws, transient, true, try, typeof, var,
volatile, void, while, with

Hope this helps.

希望这可以帮助。