当前位置:网站首页>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 :

边栏推荐
- SQL FOREIGN KEY
- Pattern matching extraction of specific subgraphs in graphx graph Computing Practice
- matlab中wavedec2,说说wavedec2函数[通俗易懂]
- Song of cactus - throwing stones to ask the way (2)
- Digital collection system development (program development) - Digital Collection 3D modeling economic model system development source code
- Moveit 避障路径规划 demo
- Introduction to database system Chapter 1 short answer questions - how was the final exam?
- [5g NR] RRC connection release
- 《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
- QVariant与Json的各种纠葛——Qt
猜你喜欢

How to use percona tool to add fields to MySQL table after interruption

Dimension table and fact table in data warehouse

Another graduation season

GraphX 图计算实践之模式匹配抽取特定子图

隐藏在 Nebula Graph 背后的星辰大海

又是一年毕业季

处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin

如何实现十亿级离线 CSV 导入 Nebula Graph

Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys

蚂蚁集团大规模图计算系统TuGraph通过国家级评测
随机推荐
Fastjson list to jsonarray and jsonarray to list "suggested collections"
C # get PLC information (kepserver) II
Aiko ai Frontier promotion (7.2)
MySQL calculates the data within the longitude and latitude range
HMS core machine learning service helps zaful users to shop conveniently
How to use percona tool to add fields to MySQL table after interruption
如何实现十亿级离线 CSV 导入 Nebula Graph
可视化技术在 Nebula Graph 中的应用
[fluent] dart language (DART language features | JIT instant compilation | AOT static compilation)
隐藏在 Nebula Graph 背后的星辰大海
Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard
Practice of constructing ten billion relationship knowledge map based on Nebula graph
微信v3native支付设置的结束时间处理办法
Flink real-time data warehouse (IX): incremental synchronization of data in MySQL
蚂蚁集团大规模图计算系统TuGraph通过国家级评测
The task cannot be submitted after the installation of flick is completed
仙人掌之歌——投石问路(3)
Invalid bound statement (not found)解决方法总结
Traversal before, during and after binary tree
数据库系统概论第一章简答题-期末考得怎么样?