JavaScript Basics - basic data types and basic process control

JavaScript foundation 1 1, Basic data type 1.Number 2.String 3.Null 4.Undefined 5.true or false 2, Common methods of string 1. Parse string number parseInt: resolve to integer parseFloat: parse to decimal var num_str = '4.5 Kilogram'; parseInt(num_str);//Return to 4 parseFloat(num_str);//Return to 4.5 2. Text common operation API Method des ...

Posted on Sun, 05 Jan 2020 06:18:33 -0800 by eheia

Sorting tables with native js

Ali's simulated written test questions were not written at that time due to the limited time. In fact, they are not familiar with the native dom operation. Here is a supplement. The main idea of the title is to have a table, as shown in the code <table> <tr> <th>Name</th> <th>Index</th ...

Posted on Sun, 05 Jan 2020 05:58:19 -0800 by Eclipse

vue realizes login function

Recently, I was learning vue, and found many pits of vue, such as how to better obtain the input box input value to reduce the consumption of getting dom nodes, and how to bind a function to execute business logic. 1, First, how to get the value of the input box The vue provides a ref attribute. Here, you need to bind the inp ...

Posted on Sun, 05 Jan 2020 02:52:13 -0800 by thoand

BOM operation knowledge points in JS

JS BOM   window object Global variables and global methods belong to window     alert-comfirm-prompt Wrap the prompt text on the alert, confirm and other pop-up boxes: \ n // confirm() // Click OK to return true,Cancel return false var btn=document.getElementById("btn"); btn.onclick=function(){ // Pop u ...

Posted on Sun, 05 Jan 2020 01:37:29 -0800 by JD*

JavaScript's FormData+Ajax implementation file upload + image upload

JavaScript's FormData+Ajax implementation file upload + image upload In many web page development, there are file upload and image upload operations. Some use the form form default function to submit files, and some use Ajax to submit files If you use the form form submission method, you need to add additional parameters or s ...

Posted on Sat, 04 Jan 2020 16:03:26 -0800 by rameshmrgn

Tumbling cloud of web effects

Effect: when the mouse moves to a menu in the navigation bar, the cloud background moves with it, and when the mouse leaves, it returns to the first menu; when there is a click event, the cloud stays in the menu clicked, and when it moves to another menu again, the mouse leaves and returns to the last menu clicked. Key knowledg ...

Posted on Fri, 03 Jan 2020 21:18:45 -0800 by danc81

Show current time - javascript

To display the Date and time on the web page, we only need to create a Date object, and we can complete the implementation of the time, but the time is fixed. That's because the time is fixed after the data is loaded on the page, so we need to display the time once a second so that the time can be updated in real time. Core cod ...

Posted on Fri, 03 Jan 2020 07:54:22 -0800 by adammo

Three.js -- about the shadow of stereo image

Most data show that when the following three conditions are met, shadows can be displayed: The renderer turns on shadow rendering: renderer.shadowMapEnabled = true; The light needs to turn on "cause shadows": light.castShadow = true; Objects need to turn on "cause shadows" and "receive shadows& ...

Posted on Fri, 03 Jan 2020 01:56:05 -0800 by pablogosse

JS DOM operations (create, traverse, get, manipulate, delete nodes)

Create Node <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>create Method</title> <script src="domReady.js"></script& ...

Posted on Thu, 02 Jan 2020 21:47:09 -0800 by luminous

JS realizes the effect of picture switching

First, take a look at the renderings. In general, click the button on the left to switch between the pictures. It seems very simple, but there are still several difficulties, so I will select this case for a good analysis. Step 1: Layout <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> &l ...

Posted on Thu, 02 Jan 2020 19:44:07 -0800 by munkee