当前位置:网站首页>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 :
边栏推荐
- 数据湖(十一):Iceberg表数据组织与查询
- Add user-defined formula (time sharing t+0) to mobile app access as an example
- 构建多架构镜像的最佳实践
- idea jar包冲突排查
- 如何实现十亿级离线 CSV 导入 Nebula Graph
- day4
- Add an empty column to spark dataframe - add an empty column to spark dataframe
- /Bin/ld: cannot find -lpam
- 图数据库|Nebula Graph v3.1.0 性能报告
- AWS云主机扩容
猜你喜欢
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
Application of visualization technology in Nebula graph
Review materials for the special topic of analog electronics with all essence: basic amplification circuit knowledge points
蚂蚁集团大规模图计算系统TuGraph通过国家级评测
Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
The sea of stars hidden behind the nebula graph
idea jar包冲突排查
How to use percona tool to add fields to MySQL table after interruption
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
隐藏在 Nebula Graph 背后的星辰大海
随机推荐
Digital collection system development (program development) - Digital Collection 3D modeling economic model system development source code
Add an empty column to spark dataframe - add an empty column to spark dataframe
floyed「建议收藏」
多数据源配置代码
Experiment collection of University "Fundamentals of circuit analysis". Experiment 4 - Research on linear circuit characteristics
Aiko ai Frontier promotion (7.2)
Best practices for building multi architecture images
Make p12 certificate [easy to understand]
全方位解读服务网格(Service Mesh)的背景和概念
Solve * * warning * *: your ApplicationContext is unlikely to start due to a @componentscan of the defau
【5G NR】RRC连接释放
蚂蚁集团大规模图计算系统TuGraph通过国家级评测
[idea] recommend an idea translation plug-in: translation "suggestions collection"
Introduction to dynamic planning I, BFS of queue (70.121.279.200)
After the win10 system is upgraded for a period of time, the memory occupation is too high
The sea of stars hidden behind the nebula graph
使用FFmpeg命令行进行UDP、RTP推流(H264、TS),ffplay接收
Boot 事务使用
Write your own CPU Chapter 11 - learning notes
隐藏在 Nebula Graph 背后的星辰大海