Dom's event model, event bubbling, preventing bubbling, and event delegation

What is the event model Dom standard event model: when an event occurs, it actually goes through three stages! Capture stage from the outside to the inside: from the root node of Dom tree to the current clicked element position, traverse and record the event processing functions bound to the parent e ...

Posted by mogster on Wed, 13 May 2020 20:54:38 +0200

Understanding of offset, curl and visibility

Offset Offset dimension is an important concept in javascript. offsetLeft, offsetTop, offsetHeight and offsetWidth are the four attributes related to offsets. Of course, there is also an offset reference -- positioning the parent offsetParent. This article will introduce this part in detail                 ...

Posted by Helljumper on Sat, 09 May 2020 10:09:11 +0200

Use JQuery to complete the check box selection

Js related technology checked property How to get all check boxes: document.getElementsByName requirement analysis When we deal with forms, in some cases, we need to deal with forms in batches technical analysis First method: selector [property name = 'property value'] $("input[type='checkbox']:gt(0)").prop("checked",this.check ...

Posted by anthonydamasco on Wed, 06 May 2020 18:02:16 +0200

Javascript process control

Javascript process control 1. Conditional statement (1)if(exp) executes a code (2)if(exp) {execute code segment;} (3)if(exp){exp is true to execute code segment} else{exp is false to execute code segment}   (4)if...else if... (5)if nesting 2. Loop statement (1)for cycle (2)while cycle (3)do/while cycle 3. Special cycle control (1)break termin ...

Posted by heckenschutze on Wed, 06 May 2020 00:42:00 +0200

koa2 implements jwt login

1.jwt Introduction Introduction is partly reproduced from Ruan Yifeng's Introduction to JSON Web Token Tutorial 0.session login 1. Users send user names and passwords to the server. 2. After the server is authenticated, save relevant data in the current session, such as user role, login time and so on. 3. The server returns a session_id to the ...

Posted by mattcooper on Tue, 05 May 2020 19:51:50 +0200

Simple data verification using JavaScript

Using JS to complete simple data verification requirement analysis Use JS to complete the simple data verification of the registration page. It is not allowed to leave the user name or password blank technical analysis from form property -- onsubmit must have a return value. If it is true, the submit is successful. If it is false, it cannot be ...

Posted by guayaquil on Tue, 05 May 2020 18:15:24 +0200

Hybrid App knowledge point collection

Native Webview knowledge: 1: Registration related authority <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 2:webview common methods goBack() //Back off go ...

Posted by MorganM on Mon, 04 May 2020 01:33:41 +0200

Vue state management Vuex

1. Overview As a plug-in, Vuex manages and maintains the component state of the whole project.   2. Install vuex cnpm i --save vuex   3. Use of vuex github address: https://github.com/MengFangui/Vuex new Vue({ el: '#app', router: router, //Use vuex store: store, render: h => { return h(App) } ...

Posted by Gurzi on Sun, 03 May 2020 22:22:07 +0200

Function extension in TS

Function extension in TS Full function type //js define function function add(x, y) { return x + y; } //Complete function defined in ts let add: (x: number, y: number) => number = function(x: numer, y: number):number { return x + y; } //The parameters in the function do not need to be consistent with the ...

Posted by Gibb Boy on Sun, 03 May 2020 13:37:36 +0200

gulp configuration es6 to es5

1. New Project The project structure is as follows: /app -- /js -- /css /dist -- /js -- /css -- index.html gulpfile.js Our code is developed in the / app directory and saved in / dist after transcoding, merging, compressing. 2. Configuring the environment (1) Initialize npm First enter the root directory and initialize the project npm ...

Posted by Frozenlight777 on Sun, 03 May 2020 11:35:14 +0200