August 1999
Intermediate to advanced
1488 pages
72h 53m
English
export
Export is a keyword used by scripts implementing security features that makes objects, properties, and methods accessible to other unsigned scripts.
Listing 6.120 shows how to use the export keyword. In the JavaScript code, the export keyword is used to make the variables, name, city, and function, showName() available to other unsigned scripts. Other scripts would access the information using the import keyword.
<html> <body> <script language = "JavaScript"> <!–– Hide // declare variables var name = "John Smith"; var city = "Atlanta"; function showName(){ alert("Your name is: " + name); } // makes two variables and ... |
Read now
Unlock full access