I tried it all night and found a method.
My head is still confused. Write it down first and analyze it later.
CopyCodeThe Code is as follows: // locate the relative position of the child element in the parent Element
Function getelementtop
To solve this problem, use the following method to load JS:
CopyCodeThe Code is as follows: var loadscript = function (URL, callback, charset ){
VaR head = Document. getelementsbytagname ('head') [0];
VaR script = Document. createelement ('script
Copy codeThe Code is as follows: isNull: function (){
Return a = null;
},
IsUndefined: function (){
Return a === undefined;
},
IsNumber: function (){
Return typeof a = 'number ';
},
IsString: function (){
Return typeof a = 'string ';
},
IsBoolean:
1. Each function contains two non-inherited methods: apply () and call ().
2. they use the same functions and call functions in specific scopes.
3. The receiving parameters are different. apply () receives two parameters: one is the function running
The first time I went to sleep, I found a lot of problems, and I couldn't understand anything. I went to bed at night and found that it was like this. After a few days, I found that my handwriting was still based on my memory, so next time, next
The automatic sequence number and automatic attribute number are as follows:Implementation principle:Adding and deleting are a reverse process and the implementation is consistent.Add the element append Method to the parent container, set all custom
Do you know what alert will output after the following JavaScript code is executed?
Copy codeCode: var foo = 1;
Function bar (){
If (! Foo ){
Var foo = 10;
}
Alert (foo );
}
Bar ();
If the answer is "10", you will be even more confused:[/Code]Var a =
I. Scope of Variables
To understand closures, you must first understand the special variable scopes of Javascript.
Variables have two scopes: global variables and local variables.
The special feature of Javascript is that the function can directly
Array Creation
First:
Copy codeThe Code is as follows: var colors = new Array ();
Var colors = new Array (20); // create an Array containing 20 items
Var colors = new Array ("Greg"); // create an Array containing 1 item, that is, the string
No matter how you write a program, you will be exposed to the coding style, design patterns, and other concepts. The encoding style is generally focused on writing specifications, while the design pattern is biased towards programming architecture
1. What is JavaScript?(1) HTML is only a markup language that describes the appearance of a Web page. It does not have computing and judgment capabilities. If all calculations are performed, it can be used to determine whether the text box is empty
1. Create mode directly. This is the simplest and most direct mode. First, create an object of the reference type and add custom attributes and methods to it. The sample code is as follows:
Copy codeThe Code is as follows: var person = new Object ();
Although many developers are happy to celebrate javascript, some still see its dark side.
Web pages using a lot of javascript code are slow to load. using javascript too much makes webpages ugly and slow. Soon how to use javascript effectively
Introduction
This section focuses on a very common ECMAScript object-function ), we will explain in detail how various types of functions affect context variable objects and what each function's scope chain contains, and answer questions such as the
JavaScript BASICS (1)Basics
Javascript: 1. Data Type and Value
Javascript: three basic types of data are allowed: Numbers, strings, and boolean values. In addition, two types of small data are supported: null and undefine ).
Javascript: it also
Js object relationship diagram JavaScript Object Reference Manual
This reference manual describes the attributes and methods of each object and provides examples.
Array
Boolean
Date
Math
Number
String
RegExp
Global
Browser Object Reference
First of all, what is a regular expression? In fact, the introduction of the concept often does not help us understand what it is, so I will briefly describe it, it is actually a string that records string rules. After reading this part, we can
Function class
DefinitionThe Function class can represent any Function defined by the developer. The syntax for directly creating a Function using the Function class is as follows:
Var function_name = new Function (agrument1, agrument2,...,
Javascript insert styles are widely used in front-end development, especially when you modify the front-end performance and page skin replacement. Recently, When you click a button on another website, a script is inserted and executed on another
Key points: 1. Determine the browser version; 2. Modify the style sheet path
The second point is often used when you modify webpage templates and Forum styles in real time. In fact, you can modify the style sheet path to load different style sheets.
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.