当前位置:网站首页>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
- 将点云坐标转换成世界坐标的demo
- 奥比中光 astra: Could not open “2bc5/[email protected]/6“: Failed to set USB interface
- Practice of constructing ten billion relationship knowledge map based on Nebula graph
- 【idea】推荐一个idea翻译插件:Translation「建议收藏」
- PyObject 转 char* (string)
- Introduction to dynamic planning I, BFS of queue (70.121.279.200)
- 仙人掌之歌——投石问路(2)
- XPT2046 四线电阻式触摸屏
- In memory of becoming the first dayu200 tripartite demo contributor
猜你喜欢

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

Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse

数仓中的维度表与事实表

Tree binary search tree

mysql 计算经纬度范围内的数据

Ant group's large-scale map computing system tugraph passed the national evaluation

MySQL calculates the data within the longitude and latitude range

Compress words (kmp/ string hash, double hash)

Boot 事务使用

Dimension table and fact table in data warehouse
随机推荐
使用FFmpeg命令行进行UDP、RTP推流(H264、TS),ffplay接收
Strings and arrays
SQL修改语句
(5) Flink's table API and SQL update mode and Kafka connector case
How to import a billion level offline CSV into Nepal graph
Moveit obstacle avoidance path planning demo
/Bin/ld: cannot find -llz4
(万字精华知识总结)Shell脚本编程基础知识
Pyinstaller's method of packaging pictures attached to exe
locate: 无法执行 stat () `/var/lib/mlocate/mlocate.db‘: 没有那个文件或目录
/Bin/ld: cannot find -lssl
win10系统升级一段时间后,内存占用过高
Solve * * warning * *: your ApplicationContext is unlikely to start due to a @componentscan of the defau
Postgressql stream replication active / standby switchover primary database no read / write downtime scenario
Xpt2046 four wire resistive touch screen
Figure database | Nepal graph v3.1.0 performance report
Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard
SQL FOREIGN KEY
睿智的目标检测23——Pytorch搭建SSD目标检测平台
Dimension table and fact table in data warehouse