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

边栏推荐
- Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse
- 《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
- 死锁的条件及解决方法
- Boot 事务使用
- Add user-defined formula (time sharing t+0) to mobile app access as an example
- Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
- fastjson List转JSONArray以及JSONArray转List「建议收藏」
- Locate: cannot execute stat() `/var/lib/mlocate/mlocate Db ': there is no such file or directory
- Golang MD5 encryption and MD5 salt value encryption
- 睿智的目标检测23——Pytorch搭建SSD目标检测平台
猜你喜欢

解决** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the defau

Tree binary search tree

idea 公共方法抽取快捷键

The outline dimension function application of small motherboard

Idea public method extraction shortcut key

Xpt2046 four wire resistive touch screen

Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard

Boot transaction usage

Traversal before, during and after binary tree

Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
随机推荐
Best practices for building multi architecture images
【5G NR】RRC连接释放
Conditions and solutions of deadlock
数据湖(十一):Iceberg表数据组织与查询
PyObject 转 char* (string)
The sea of stars hidden behind the nebula graph
Comparison between rstan Bayesian regression model and standard linear regression model of R language MCMC
Make p12 certificate [easy to understand]
SQL FOREIGN KEY
XPT2046 四线电阻式触摸屏
6092. Replace elements in the array
win10系统升级一段时间后,内存占用过高
愛可可AI前沿推介(7.2)
Register as a harmonios developer and install deveco studio 3.0 beta2 for harmonios
手机app通达信添加自定义公式(分时T+0)为例子讲解
Multi data source configuration code
Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse
Usage of group by
SQL modification statement
数据库系统概论第一章简答题-期末考得怎么样?