Get the size of the browser window

... --Advertising placeholder-- Get the size of the browser window: <script type="text/javascript"> function getInfo(){ var s = ""; s += "网页可见区域宽:" + document.body.clientWidth; s += "<br>网页可见区域高:"+ document.body.clientHeight; s += "<br>网页可见区域宽:"+ document.body.offsetWidth ...


Check for an existing, non-empty string

... Requirement: Verify that a variable str has been defined, is a string, and is not empty Background: var str1 = 'test' ; //string literal Var str2 = new String('test'); //String object Str1 == str2; //true, str2 is implicitly converted Str1 === str2; //false Just to consider the problem:...


Compare typeof with instanceof

... : pointof and instanceof in JavaScript are often used to determine whether a variable is empty or what type. typeof Definition and usage: The return value is a string that describes the data type of the variable. Detail: (1), typeof can only return the following results: number, boolean...


JavaScript you don't know - strictly equal and loose equal

... loose equals == and strict equals === are used to determine whether two values ​​are "equal", but between them There is a very important difference, especially in terms of judgment. A common misunderstanding is "== check if the values ​​are equal, === check if the values ​​and types are...


Who exactly refers to this - the execution context

... The first thing that must be said is that the point of this is not determined when the function is defined. Only when the function is executed can you determine who this is pointing to, in fact this The final point is the object that called it (the function that calls it directly) 1)...


In the vue project, the use of the image path.md

... in the vue project using the application vue-cli in the image path, the image is usually saved in the src/assets directory or in the static directory, src directory The files below need to be referenced when webpack is packaged. The static directory is directly referenced without...


WeChat applet todolist pass

... 简单todolist Tip: Get the value of the form element Getval:function(e){ E.detail.value==value of the form element } Sel:function(e){ E.target.dataset.index==Subscript of the output list element } Bindinput: The event triggered by the change of input <input type="text" bindinput="getval...


Springboot-thymeleaf

... 1, Introduction Thymeleaf is a server-side Java template engine for web and standalone environments. It can handle HTML, XML, JavaScript, CSS or even plain text. The main goal of Thymeleaf is to provide a simple, more maintainable way to create templates. To achieve this, it is based on...


JavaScript basics (3) Basic objects

... 基本 基本: 1. Function: Function (method) object 1. Create: 1. var fun = new Function (form argument list, method body); // forget it 2. Function method name (formal parameter list) { Method body } 3. Var method name = function (form argument list) { Method body } 2. Method: 3. Attributes:...


The CSS box model

... CSS box model is divided into standard boxes and IE boxes, so what is the difference between the two? We run the following code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Box Model</title> <style type="text/css"> #box...