1. Broker ModeThe role of the mediator pattern is to remove the tight coupling between objects and objects, and when an intermediary is added, all related objects communicate through intermediaries and no longer refer to each other1.1 Example of the
JavaScript's basic type values and reference type values have the following characteristics;1, the basic type value in memory occupies a fixed size, so it is stored in the stack memory;2, the reference type value is an object, stored in the heap
This article starts with the asynchronous style and analyzes the techniques, problems, and solutions that have become asynchronous in JavaScript. Specifically, from the problems caused by the callback, and talked about the use of events, Promise,
Call methodApply to: Function ObjectInvokes one method of an object, replacing the current object with another object.Call ([thisobj[,arg1[, arg2[, [,. ArgN]]])Parameters:ThisobjOptions are available. The object that will be used as the current
JavaScript gets the URL parameter code instance:Sometimes you might need to get the parameter values in the URL, and here's a related code instance.The code is as follows:varUrl= "Www.softwhy.com/test.php?id=21&a=5"; if(Url.indexof ("?")! =-1){
There are several ways to reduce the impact of JavaScript on performance:
Placing all the labels at the bottom of the page, that is , before closing the tag, ensures that the page has been rendered before the script executes.
Merge the
JavaScript operatorsA combination of operators and operands is called an expression.Second, JavaScript operators(i) Arithmetic operators+-*/% var++ ++var var----varA. +(1) Operations for numeric values(2) Connection for strings***********************
1. JavaScript subsetThe definition of a subset of JavaScript is mostly for security reasons, and only a secure subset of the language is used to script the code to make it more secure and stable, such as how to perform a more secure ad code that is
Array ObjectAn array object is a collection of objects that can be of different types. Each member object of an array has a "subscript" that represents its position in the array, which is zero-basedMethod of array Definition:1. Defines an empty
Match numbers and strings
Integer or decimal: ^[0-9]+\. {0,1} [0-9] {0,2}$
Only numbers can be entered: "^[0-9]*$".
Only n digits can be entered: "^\d{n}$".
Only numbers with at least n digits can be entered: "^\d{n,}$".
You
For example, when JavaScript performs read/write operations on cookies, javascriptcookie
This example describes how JavaScript reads and writes cookies. Share it with you for your reference. The details are as follows:
No js library is used here.
Adjust the default length of password text in input by style, inputpassword
Original Source
when the types in the tag are password and text, their default length and width are inconsistent, and the length and width of the types in the logon box
Obtain the Baidu map key and map key
Today, when I opened my website, this problem occurs: "Baidu is not authorized to use the map API, it may be because the key you provided is not a valid Baidu Open Platform key or this key is not authorized to
Javascript Ajax to obtain and set Headers
Header-related methods in the XMLHttpRequest object:
SetRequestHeader (
,
) -- Set the header with the specified value;
GetResponseHeader (
) -- Get the value of the specified
Node. js operates mysql (add, delete, modify, and query) and node. jsmysql
Recently, I have been studying Node for a while. Although it is a bit simple, I think it is a good idea. In fact, all projects are addition, deletion, modification, and query,
Javascript removes the comments in the Code and javascript removes the comments.
The code is very simple. It is mainly implemented using regular expressions and directly presents the code.
Reg =/("([^ \"] * (\.)?) * ") | ('([^ \'] * (\.)?) * ') | (
[Original] CSS summary !! The second article about HTML !!, Css Article 2
Similarly, I used xMind to upload CSS and DIV tomorrow. Today, only CSS is available.
But first, it involves the browser principle: there are still many modules that you don't
Introduction to css3 box model and the use of box-flex, css3box-flex
Display: box; box-flex is the new box model attribute added by css3. Its appearance can solve the layout through N multi-structure and css implementation. A typical layout
Basic JS types and reference types
Js:
1. The ECMAScript variable contains two different types of values: basic type value and reference type value;
2. Basic Type value: refers to the simple data segment stored in the stack memory;
3. Reference Type
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service