Copy Code code as follows:
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
Test test test test test test testing
test test test test test test test test testing
test test test test test test test testing
test test
How to improve JavaScript execution efficiency and performance in the front-end development is located in a very important place, this section to study how in peacetime to do the project process, improve JavaScript performance and operational
Displays a layer where the mouse is clicked on a Web page for the user to select a location and to display the user's selected location in a text box. Mainly is the control layer's display, hides.
Copy Code code as follows:
Put the code in the global JS file:
JS Code
Copy Code code as follows:
/**
* Delete array specify subscript or specified object
*/
Array.prototype.remove=function (obj) {
for (var i =0;i var temp = this[i];
if (!isnan (obj)) {
Temp=i;
Many times we use a for to generate multiple structures with the same structure, so we need to write a lot of createelement, setattribute, appendchild code.But in fact we only need to have an HTML template, we can use the CloneNode method to clone
It is mainly through the analysis of the Document.cookie string to perform functional assembly.
brush up on the cookie action in javascript:
Adding cookies can be achieved by document.cookie= "userid=111";
The full version can be
Recently in the revision of Baidu map open source things, want to be coupled inside the code to split out. After dismantling, found some problems of pit dad. If there is no logical problem, the effect does not appear. Then think that is the code
This feature is often used in replies and references, that is, clicking a reply or reference, such as having the input focus appear in the message input box, and if the anchor is used to locate, the input focus cannot be activated.
Copy Code
One, variable
• Global Variables
The two features of JavaScript, unconsciously creating global variables are surprisingly easy. First, you can use variables without even having to declare them; second, JavaScript has an implied global concept,
In JavaScript, the usual random numbers are duplicated, but sometimes we need random numbers that are not repeated, how do we implement them? Here are three ways to produce random numbers that are not duplicated, and compare them to see how
In general, you will use the following method to do the phonetic sorting of Chinese characters
Copy Code code as follows:
var list = [' King ', ' Zhang ', ' Lee '];
List.sort (function (A, b) {
return A.localecompare (b);
});
1.document.write (""), for Output statements
The annotation in 2.JS is//
3. Traditional HTML Document order is:document->html-> (head,body)
4. The DOM order in a browser window is:window-> (navigator,screen,history,location,document)
5. Get the name
The main two parts, one, is the rolling content part of two, JS scrolling code, there are only two words.
first, the traditional rolling code
Use JavaScript to achieve the level of news content scrolling!
[Ctrl + A All
Note : The translation of what is not appropriate place, we welcome you to correct, I wish you a happy double section!The practice of extending native objects and prototypes (prototype) without special needs is not good
Copy Code code as
1. These two methods, if the match succeeds, returns an array, the match fails, and returns NULL.
2. When the global property of the RegExp is false, the return array of the two methods is the same.
The No. 0 element of the array is the first
As the author of the translation will add their own understanding in order to learn and use, if the English good students can see the following, such as a translation error in the article, please leave a message. Communicate and correct. (:==========
Free to do nothing, spent two days, with JavaScript wrote a dozen peas game, as for how to play the do not elaborate, to search the internet to know, very simple.
The following is the source code, published out for everyone to learn and
Copy Code code as follows:
Example:
This is a fuzzy search with Ztree.
At first all the tree nodes are closed, but if the input search content when the query, expand the query content of the parent node, will make the input
The following constructor is defined with gusto:
Copy Code code as follows:
var coder = function (Nick) {
This.nick = Nick;
};
What happens after the constructor is defined? Yes, hastened to instantiate:
var coder = coder
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.