The version of JavaScript implemented in AppWeb is a small subset suitable for embedded systems. As JavaScript 1.2 is now quite a large language, its size prohibits its use in most embedded devices. Embedded JavaScript is designed to solve this dilemma. It is a strict subset of JavaScript that implements the essential elements of the language and is extensible by the user to support new functions. Embedded JavaScript is used by Embedded Server Pages to allow access to HTTP variables and to get dynamic data for presentation to the client's browser. When used inside an ESP web page, it consists of a script within ESP tag delimiters. FeaturesEmbedded JavaScript implements the following JavaScript language elements:
The following language elements are not implemented:
The supported operators are:
The supported conditional operators are:
Embedded JavaScript is multithreaded and will support multiple simultaneous instances. When used by ESP, each JavaScript session has its own local variable store and can share data via the session data store.
JavaScript ProceduresThe JavaScript capabilities may be extended by publishing new JavaScript functions. JavaScript functions may be created by instantiating a n object that implements the MprEjsProc subclass or by calling the maDefineEsp() C function to link a C function to a JavaScript procedure. See the Programmers Reference for more details.ExamplesBasic Iterationvar i, j;
Including JavaScript libraries (Server-side)<% include("inc.js"); %>
ESP Variable Access<% i=2; %> Scripted HTML
|
Quick Nav
Features |