It is mentioned that "Dom is the UTF-8 of the article code, if the JS library is not the separation of independent JS files, but included in the Dom, this problem will not appear. However, the separated JS file is not UTF-8 encoding, is added to the
First, let's talk about the occurrence of this bug.
CopyCodeThe Code is as follows:
In such a tag, the JS Code in onclick is to change the src attribute of the IMG tag whose ID is current to achieve dynamic switching of images. Unfortunately, ie
For example:
CopyCode The Code is as follows: var anchors = Document. getelementsbytagname ("");
For (I = 0; I VaR ele = anchors [I]; // obtain an element
// Some code here
}
The code above indicates getting all the link elements in the document,
To work, use JavaScript to make a statistical chart:
After that, take a note to share and learn from each other. There are still some problems, which are not perfect yet.
Refer to the JS statistical charts of Baidu space, central management center,
I believe that every developer knows the importance of caching. Cache backend (such as memcached and xcache) from the beginning to the end .) To reduce the pressure on the database. You want your browser to cache more than once loaded Resources in
Series Introduction Perhaps Sir Isaac Newton (Sir Issac Newton, three hundred-1643), 1727 years ago, has not imagined that physics is widely used in many games and animations today. Why should physics be used in these applications? I believe that
ArticleDirectory
Usage
Working Principle
Example: menu Effect
File Download and update instructions:
This is cool, because it allows you to apply the special effect of a mouse over an event (Mouseover) to a table row () only
1. Interface Design
Index.html: provides only one placeholder for the position displayed by the wizard.
Copy codeThe Code is as follows:
GIFT recommendation wizard
Style.css: by default, the wizard contains a title rendered by h2, a
Today, we will introduce how to generate an instance that "inherits" multiple objects.
For example, there is a constructor of an "animal" object,
Copy codeThe Code is as follows: function Animal (){
This. species = "animal ";
}
There is also a
Below is a self-written class, which contains fields and methods.
Copy codeThe Code is as follows: // Constructor
Function Person (name, sex, age ){
This. name = name;
This. sex = sex;
This. age = age;
};
Person. prototype. getName = function
The order may be messy. If you write more words, some terms may not be used properly. You are welcome to criticize and correct them. The following sample programs have been verified by myself and are compatible with various browsers. OK.
1.
DescriptionThis is mainly to exercise yourself and has no practical significance.
The data tested by each browser is different. For example, if I use chrome for testing, the fast sorting will usually be the fastest, and IE may be the fastest in the
For more information, see the attachment example.
1. cookie functions:Copy codeThe Code is as follows :/*** Cookie operation tool.* Usage: Save value: CookieTool ('name', '1', {expires: 7}) // indicates that a cookie value is saved as 1 and the key
Copy codeThe Code is as follows:
When a function is called by a non-IE browser, the parameter event is automatically returned, through which the keyboard can be obtained.Copy codeThe Code is as follows:
For example
Copy codeThe Code is as follows: setTimeout (function (){
Alert ('Hello! ');
}, 0 );
SetInterval (callbackfunctions, 100 );
It is assumed that the greeting method in setTimeout will be executed immediately, because it is not just a thin
Copy codeThe Code is as follows:
Box without any options parameter (the default height is 200px and the width is 300px)Ordinary box with a set height and widthBox with high width adaptive content and high widthBox without pre-loaded AnimationBox
However, I also told people that, because too many parameters are accepted, I often don't know how to use smart prompts unless I write them clearly.
However, when many parameters are accepted, in addition to making mistakes, there will be another
This is a special property. Inheritance in Javascript generally depends on this property.
In Javascript, everything is an object. strings are objects, arrays are objects, variables are objects, and functions are objects. Therefore, ['A', 'B ', 'C'].
Copy codeThe Code is as follows:
DEMO code:[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Source: http://www.cnblogs.com/airy
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