Home > Web Front-end > JS Tutorial > body text

Miscellaneous talk about execution environment in javascript_javascript skills

WBOY
Release: 2016-05-16 18:03:33
Original
920 people have browsed it

——This starts with the JAVASCRIPT interpreter: Whenever the JAVASCRIPT interpreter starts to execute a function, it will create an execution environment and generate a variable object closely related to the function. In this execution environment All variables or functions defined in will be saved by him. But he is like a relevant department, which may be closely related to you, but you will never find him. You cannot call this object, but the JAVASCRIPT parser will call it when processing data.
That’s it for the topic. Let’s talk about the execution environment in real terms. Let's start with the global execution environment. It is the outermost of the entire execution environment and is added as an attribute of the window object.
For example:

Copy code The code is as follows:









The chestnut above will eventually pop up true. In other words, the global variables we defined at the outermost periphery are eventually integrated into the window. Whenever all the code in an execution environment is executed, the definitions of variables and functions in it will be downloaded and destroyed. Those who eat fruit will die like a dog.
But what I have to say is that the implementation of Javascript allows multiple global execution objects. Nani? ! Yes, let’s use a bad example: IFRAME. The owner in IFRAME is different from the global environment of the browsing window. Of course, if cross-domain attribute acquisition is involved, then security is a concern. Well, that's it. That’s all
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!