JavaScript's application environment is mainly the host environment (host environment) and the run-time environment composition. Where the hosting environment refers to the shell (shell) and web browser, and the runtime environment is built by the JavaScript engine.
Hosting environment
A hosting environment is a design that is designed to isolate code, language, and specific platforms. On the one hand we cannot allow the browser to have a huge operating environment (virtual machine is a platform with a particularly large runtime environment), on the other hand, the server side needs a strong environment, so JavaScript is designed to "host environment" language.
The ECMAScript specification does not provide a clear definition of the hosting environment. That is, there is no standard input (stdin) or output (stdout) to which specific object it is presented. Later, RWC in the Webapis specification first proposed a "Need a Window object" browser environment. This means that in RWC or on the browser side, the input output is provided with the Window object and the Document object in it. However, the "host environment under the RWC specification" does not equal the "host environment under the JavaScript specification"
Method |
Meaning |
|
alter (smessage) |
displays a message text (string) and waits for the user to respond once. The caller ignores the return information of the response |
|
write (Stext, ... |
output a piece of text, and multiple parameters will be concatenated into a single string literal. |
|
Writein (Stext,...) |
Output a piece of text (with write), multiple parameters are concatenated into a single string literal, and a newline character is appended to the end of the text (\ n) |
Note: Write () and Writein are the methods of the Document object in the browser.
Shell Program
The shell is one of the hosts.
Run-time environment
Different books have inconsistent interpretations of their definitions:
For example, in the JavaScript authoritative guide, it consists of the JavaScript kernel (CORE) and the client JavaScript two parts;
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/92/82/wKiom1kAOluyvuDBAAAYTWoEV3o846.png-wh_500x0-wm_ 3-wmp_4-s_1160389310.png "title=" 20170426134726.png "alt=" Wkiom1kaoluyvudbaaaytwoev3o846.png-wh_50 "/>
core ECMAScript , Browser object Model (BOM) three components.
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/92/82/wKiom1kAOniCGtSgAAAqWkiPkrQ748.png-wh_500x0-wm_ 3-wmp_4-s_2708317499.png "title=" 20170426135000.png "alt=" Wkiom1kaonicgtsgaaaqwkipkrq748.png-wh_50 "/>
In the initial state of the run-time environment mainly includes:
A convention on the host
An engine core
A set of objects and APIs
Some of the other specifications
Common JavaScript engines
engine |
apply |
language |
note |
spidermonkey |
mozilla |
c |
|
javascriptcore |
safari |
c++ |
based on KDE published KJS, supported by Apple Inc. |
rhino |
java |
java |
mainly used in the Java platform of IBM, Sun, etc. |
jscript |
windows |
|
windows environment, and IE |
Narcissus |
|
Javascript |
Notes |
Remarks *:brendan Eich A set of code written to verify the self-realization of the JavaScript language, called "JS implemented in JS"
This article is from the "Sun nuo" blog, please be sure to keep this source http://10479756.blog.51cto.com/10469756/1919595
JavaScript Learning notes ———— JavaScript application environment