当前位置:网站首页>The seventh training assignment
The seventh training assignment
2022-07-07 10:57:00 【m0_ sixty-three million five hundred and fifty-two thousand nin】
1. Built-in objects
argument Defined only inside the function , Save the arguments of the function
Array Array objects
date Date object , Used to create and obtain objects
math Mathematical objects
string String object , Provides a series of operations on strings
1.2string
charAt(idx) Returns the character at the specified location
indexof Returns the specified string position , From left to right , Cannot find return one
substring Returns the specified string m Position start , take n Characters , If parameters N Omit , It means getting the end of the string
1.3math
math.random() random number
math.ceil Rounding up , Greater than the maximum integer
1.4date
getfullyear() year
getmonth() month
getdate() Japan
gethour() when
getminute() branch
getseconds() second
explain :
getmonth() month : Time to get 0~11
setmonth(): Time set 0~11
2. object
The object is javascript Core concept of , It is also the most important data type .javascript All data types of can be regarded as objects .javascript Provide multiple built-in objects . Objects are special data types with properties and methods .
{
key : value .
key 2: value 2.
}
2.1 Object creation
js Create custom objects , There are three main ways : Literal form creation , adopt new object objects creating , adopt object Object's create Method to create an object
1. brief introduction
javascript Is an object-oriented capability , Interpretive programming language . A little bit more specific , It is an object driven and relatively secure client segment scripting language , His main purpose is , Verify the data sent to the server , increase wed Interaction , Enhance user experience
1.1.1 object
Object is plus javascript Core concept of , It is also the most important data model ,javascript All of the data can be treated as objects ,javascript Provide various internal service objects , Objects are special data types with properties and methods , In short , The object , It's an unordered set of data , It consists of several straight pairs , adopt javascript We can create our own objects ,javascript The song of this key value pair with opposite satisfaction is what we call json, I'll see you a lot later , The great json object
1.1.2 Serialization and deserialization of objects
serialize js Object serialization string , Deserialization means that the string is deserialized to js object ,js By calling json Method , You can sequence objects into strings , You can also deserialize strings into objects
1.1.3this
this yes javascript A keyword of language , It represents the function runtime , Automatically generate an internal object , Can only be used inside a function , As the function is used in different situations , Similar words will also change , But there is a general principle , This refers to the object that calls the function
2.JS event
2.1 event
Event is javascript Use the beating heart to interact with the page , When we interact with wed Some types of interactive events happen when the page is in progress , The event may be that the user clicks the mouse over certain elements or presses certain keys on the keyboard , It could be WED What happens in the browser , For example, a certain wed The page is loaded or the user scrolls to create a fire to change the window size , By using JavaScript You can monitor the occurrence of special time .
2.2 effect
1. Data entered by the user
2. Increase the dynamic effect of the page
3. Increase user experience
2.3 Several nouns of events
Event source : Who touched the event
Time name : What event triggered
Event monitoring : Who monitors this event
Event handling : What should I do when it happens
2.3 Event flow and event model
We all have a specific event source , For the time being, consider the event source as html Some element of , Then be a html When the element produces an event , This event will propagate in a specific order between the element node and the root node , All nodes passing through will be affected by this event. This propagation process is called dom Flow of events ,
There are two types of chronological order , Event capture and event bubbling , Bubbling and trapping are actually different representations of event flow , The reason for these two is love one and netscape Two big companies have completely different concepts of event flow ,ie Events are events bubbling ,netscape The event stream of is the event capture stream
3.1html Event handler
Each event supported by an element can use a with the same name as the corresponding event handler html Characteristics to develop , The value of this feature should be able to execute javascript Code , There are some disadvantages in doing so , for example , Too high coupling can also cause time difference , And on different browsers , May have different effects
3.2domo Event handler
adopt javascript The traditional way to specify event handlers , Is to assign a function to a time handler property , This approach is supported by all modern browsers , This method first requires a reference to the object to be operated , Every element has its own thing , Build handler properties , These attributes are usually all recreational , Then set the value of this attribute to a function , You can specify the world handler
边栏推荐
- Those confusing concepts (3): function and class
- "Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions
- Laya common script commands
- Installation and configuration of slurm resource management and job scheduling system
- Compile QT project script with qmake
- Mendeley--免费的文献管理工具,给论文自动插入参考文献
- 2022.7.6DAY598
- Some online academic report websites and machine learning videos
- 2022.7.3DAY595
- 【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘
猜你喜欢

How to prepare for the advanced soft test (network planning designer)?

Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master

IIC Basics

Using U2 net deep network to realize -- certificate photo generation program

Deep understanding of Apache Hudi asynchronous indexing mechanism

【推薦系統 01】Rechub

使用Tansformer分割三维腹部多器官--UNETR实战
![[OneNote] can't connect to the network and can't sync the problem](/img/28/9a02b1da0f43889989a9539c9fb6b6.png)
[OneNote] can't connect to the network and can't sync the problem

MONAI版本更新到 0.9 啦,看看有什么新功能

【推荐系统 01】Rechub
随机推荐
【亲测可行】error while loading shared libraries的解决方案
[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)
CAS mechanism
【pyqt】tableWidget里的cellWidget使用信号与槽机制
[pytorch 07] hands on deep learning chapter_ Preliminaries/ndarray exercises hands-on version
Deep understanding of Apache Hudi asynchronous indexing mechanism
[daiy5] jz77 print binary tree in zigzag order
在线硬核工具
Deeply understand the characteristics of database transaction isolation
中级软件评测师考什么
Gym installation pit records
Basic introduction of yarn and job submission process
How to prepare for the advanced soft test (network planning designer)?
【推薦系統 01】Rechub
2022.7.4DAY596
软考中级有用吗??
How to play video on unityui
Wallhaven壁纸桌面版
A case of compiling QT file qmake compiling script
Unity script generates configurable files and loads