2nd chapter, using JavaScript in HTML
HTML introduces external JS script
should not be placed between scripts because it will not be executed
tag has a defer property that can delay script execution, but does not guarantee
ANGULAR4-Template Syntax 1. Introduction to template Syntax HTML is the language of the angular template. Almost all HTML syntax is a valid template syntax. The notable exception, however, is the element, which is disabled to prevent the risk of a
wrote a str = "s" + +;
Then there was Nan, and for a while.
The information collected is as follows:
1. Judge undefined:
Copy Code code as follows:
var tmp = undefined;
if (typeof (tmp) = = "undefined") {
Alert ("undefined");
1. Identifiers:An identifier is the name of a variable, function, property, or parameter of a function.Naming rules for identifiers:(1) The first character must be a letter, underscore, or dollar sign(2) Other characters can be letters, underscores,
Learning a language string and array methods is a must to learnIn detail, i'll give you a little bit of reference.String Type Basics
Character literal
The String data type contains some special character literals, also known as escape
Learning Essentials:1.typeof operator2.Undefined type3.Null type4.Boolean type5.Number type6.String type7.Object typeThere are 5 simple data types in ECMAScript: Undefined, Null, Boolean, number, and string.There is also a complex type--object.
wrote a str = "s" + +;Then nan appeared for a while.The information collected is as follows:1. Judge undefined:?
1234
vartmp = undefined; if(typeof(tmp) == "undefined"){ alert("undefined"); }
Description: typeof
This article mainly introduces JavaScript six data types and special attention points, the need for friends can refer to the Six types of data that are common in JS: string type, NULL type, Number type, Boolean type, Object type. 1, typeof
The following sections are categorized as follows:
The source of the 1.call/apply/bind method
2.function.prototype.call ()
3.function.prototype.apply ()
3.1: Find the maximum number in the array
3.2: Change the empty element of the array to
wrote a str = "s" + +;
Then there was Nan, and for a while.
The information collected is as follows:
1. Judge undefined:
Copy Code code as follows:
var tmp = undefined;
if (typeof (tmp) = = "undefined") {
Alert ("undefined");
}
This code was called the world's shortest IE judgment code before IE9. The code is short but contains a lot of basic javascript knowledge. Var ie =! -[1,];
This code was called the world's shortest IE judgment code before IE9.The code is short but
Varie! -[1,]; & nbsp; this code was called the world's shortest IE judgment code before IE9. The code is short but contains a lot of basic javascript knowledge. In this example, the toString () method of the array will be called before code
? It is used to check whether the variable before the question mark is null or undefined.
Stu2: Student = {ID: 1, name: undefined, age: 3 }; stu2 name {stu2 !. Name }} // stu2 name stu2 ID {stu2 !. Id }} // stu2 Id 1! It is used to check whether
The usage of PHP empty (), isset (), and is_null () functions has been discussed a lot.
The test type is as follows:
Empty () is the var_dump output of empty first:
Program output: bool (true) can be seen from the code, empty () outputs true if
Three inheritance implementation methods in javascript and javascript3
Implement class inheritance using Object. create
The following is an example of the official website.
//Shape - superclassfunction Shape() { this.x = 0; this.y =
Var ie =! -[1,];
This code was called the world's shortest IE judgment code before IE9. The code is short but contains a lot of basic javascript knowledge. In this example, the toString () method of the array is called before code execution. When
Recently found in the Project $.noop () function, because previously did not use the query, now organized as follows: jQuery.noop()A function is an empty function , and it does nothing.When you need to pass in a function parameter at some point,
1. Defer attribute of script2. Add a script for the body3. CDATA section4. null and undefined Variables5. Reduce JavascriptCode
1. Defer attribute of script
If the defer attribute is set to "Defer", the script does not generate any document
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.