当前位置:网站首页>JS learning notes - first acquaintance
JS learning notes - first acquaintance
2022-07-02 16:01:00 【Dumb monkey】
JS The composition of

ECMAScript
ECMAScript By ECMA The international ( The former European Association of computer manufacturers ) A programming language for standardization , This language is widely used on the world wide web , It is often called JavaScript or JScript , But actually the latter two are ECMAScript Language implementation and extension .
ECMAScript: ECMAScript Specifies the JS Programming syntax and basic core knowledge , It's a set that all browser manufacturers follow JS Grammar worker Industry standards .
DOM- Document object model
Document object model ( Document ObjectModel , abbreviation DOM) , yes W3C Organization recommended standard programming interface for extensible markup language . adopt DOM The interface provided can operate various elements on the page ( size 、 Location 、 Color, etc. ).
BOM A browser object model
BOM (Browser Object Model , abbreviation BOM) The browser object model , It provides content independent 、 Object structure that can interact with browser windows . adopt BOM You can operate the browser window , Like pop-up boxes 、 Control browser jump 、 Get resolution etc .
JS Yes 3 In writing form , In line 、 Embedded and external .
Inline
<input type="button" value=" Let me try " onclick="alert ('Hello World')" />
Single or small JS The code is written in HTML In the event attribute of the tag ( With on The properties of the beginning ), Such as : onclick
Pay attention to the use of single and double quotation marks : stay HTML We recommend using double quotation marks , JS We recommend using single quotation marks
Poor readability , stay htmI Written in S A lot of code , Imitation reading ;
Quotation marks are fallible , When multiple nested quotes match , It's very easy to confuse ;
Use in special cases
Embedded JS
<script>
alert('Hello World~!') ;
</script>You can do more than one line JS The code writes <script> In the label
Embedded JS It's a common way of learning
external JS file
<script src="my.js"></script> Good for HTML Page code is structured , Put a big piece of JS The code is independent of HTML Off the page , It's beautiful , Facilitate file level reuse
Quote external JS Of documents script No code can be written in the middle of the tag
Suitable for JS In the case of large amount of code
notes
Single-line comments ctrl + /
Multiline comment Default shortcut shift + alt + a
Input and output
In order to facilitate the input and output of information , JS Some input and output statements are provided in , The common sentences are as follows :

边栏推荐
- Solve the problem of base64encoder error
- How to use percona tool to add fields to MySQL table after interruption
- After the win10 system is upgraded for a period of time, the memory occupation is too high
- Digital collection system development (program development) - Digital Collection 3D modeling economic model system development source code
- 奥比中光 astra: Could not open “2bc5/[email protected]/6“: Failed to set USB interface
- /Bin/ld: cannot find -lssl
- SQL FOREIGN KEY
- 【idea】推荐一个idea翻译插件:Translation「建议收藏」
- Boot 事务使用
- Boot 中bean配置覆盖
猜你喜欢

注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS

Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin

Tree binary search tree

Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals

Traversal before, during and after binary tree

Introduction to Dynamic Planning II (5.647.62)

Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network

Construction and business practice of Zhongke brain knowledge map platform

Introduction to dynamic planning I, BFS of queue (70.121.279.200)

如何实现十亿级离线 CSV 导入 Nebula Graph
随机推荐
PHP static members
Some problems about pytorch extension
matlab中wavedec2,说说wavedec2函数[通俗易懂]
The sea of stars hidden behind the nebula graph
HMS core machine learning service helps zaful users to shop conveniently
睿智的目标检测23——Pytorch搭建SSD目标检测平台
Application of visualization technology in Nebula graph
SQL修改语句
/Bin/ld: cannot find -lxslt
Wise target detection 23 - pytoch builds SSD target detection platform
Demo of converting point cloud coordinates to world coordinates
Pyobject to char* (string)
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
Tree binary search tree
可视化技术在 Nebula Graph 中的应用
Flink real-time data warehouse (IX): incremental synchronization of data in MySQL
Floyed "suggestions collection"
Best practices for building multi architecture images
Invalid bound statement (not found) solution summary
Xpt2046 four wire resistive touch screen