What is JavaScript?

2025-04-18 19:46:13

1、The JavaScript EngineDifferent engines have different “codenames”, for example:1.V8– in Chrome and Opera.2.SpiderMonkey– in Firefox.There are other codenames like “Trident”, “Chakra” for different versions of IE, ChakraCore” for Microsoft Edge, “Nitro” and “SquirrelFish” for Safari etc.

2、How engines work?1.Engines are complicated. But the basics are easy.2.The engine (embedded if it’s a browser) reads (“parses”) the script.Then it converts (“compiles”) the script to the machine language.3.And then the machine code runs, pretty fast.The engine applies optimizations on every stage of the process. It even watches the compiled script as it runs, analyzes the data that flows through it and applies optimizations to the machine code based on that knowledge. At the end, scripts are quite fast.

3、What can in-browser JavaScript do?The mo蟠校盯昂dern JavaScript is a “safe” programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.In-browser JavaScript can do everything related to webpage manipulation, interaction with the user and the webserver.For instance, in-browser JavaScript is able to:1.Add new HTML to the page, change the existing content, modify styles.2.React to user actions, run on mouse clicks, pointer movements, key presses.3.Send requests over the network to remote servers, download and upload files (so-calledAJAXandCOMETtechnologies).4.Get and set cookies, ask questions to the visitor, show messages.Remember the data on the client-side (“local storage”).

4、What CAN'T in-browser JavaScript do?JavaScript's abilities in the browser are limited for the sake of the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.

5、What makes JavaScript unique?There are at leastthreegreat things about JavaScript:1.Full integration with HTML/CSS.2.Simple things done simply.3.Supported by all major browsers and enabled by default.Combined, these three things exist only in JavaScript and no other browser technology.That's what makes JavaScript unique. That's why it's the most widespread tool to create browser interfaces.While planning to learn a new technology, it's beneficial to check its perspectives. So let's move on to the modern trends that include new languages and browser abilities.

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:96
  • 阅读量:70
  • 阅读量:74
  • 阅读量:58
  • 阅读量:44
  • 猜你喜欢