Compile and maintain object-oriented JavaScript code [translation]. For more information about js object-oriented programming, see. Writing maintainable Object-Oriented (OO) JavaScript will save you money and make you popular. Don't believe me? Odds
I often complain that jQuery's DOM operation performance is not good and I often try to optimize it using some methods. But the more optimized, the more frustrated I find that jQuery is actually doing well, optimization from the user's point of view
The following describes the jQuery methods used earlier: find and children. For more information, see. Let's take a look at the English explanation:
Children method:
Find method:
The above explanations can be summarized as follows:
1: both
The clipboardData object provides access to the predefined clipboard format for use during editing.
ClipboardData objectProvides access to the predefined clipboard format for use in editing operations.
Member table
Method description
ClearData
JQuery can greatly reduce the workload. In actual development, the clone (true) function of jQuery is used. This function can create a copy of a jQury object and the parameter is true, you can copy all event handlers for this element.
Figure
I think this is a very common thing. Many other js frameworks have them, but they are too big to use too much. I wrote them myself. For more information, see. The following is the html test code:
The Code is as follows:
AutoComplete
Jquery keyboard event introduction. If you are using jquery, refer.
I. First, you need to know:
1. keydown ()
The keydown event is triggered when the keyboard is pressed.
2. keyup ()
The keyup event is triggered when the key is released, that
Add code statistics to your website! The common method is to directly add the statistics code to the webpage, but how many web pages do you have? The following example shows a simpler method:
Save the Statistical Code to one file: file path:/config/
Interesting JavaScript Array code example. For more information about js learning, see. Pay attention to the following situations.
First:
The Code is as follows:
Var lennon = Array ();Lennon ["name"] = "windy ";Lennon ["year"] = "1989
Many skillful JavaScript codes were used in the public backend of the public exhibition. The most representative example is as follows.
The Code is as follows:
IE has many easy-to-use methods and is later copied by other browsers, such as the contains method. If element A contains Element B, true is returned; otherwise, false is returned. The only thing that does not support this method is the opposite of
Obtains the element set of all child elements of each element in a matched element set. Children ([expr])
Obtains the element set of all child elements of each element in a matched element set.
You can use an optional expression to filter matched
Recently, you need to use JQuery to dynamically operate the table. After sorting it out, you can add a new row and delete one or more selected rows. The simple code is as follows:
The Code is as follows:
Recently, avtivex controls were used in company projects. It has never been used before. I sorted out the usage methods found everywhere recently. First, add avtivex to the page.
The Code is as follows:
Javascript code
The Code is as
This method is a method to convert a able into a string. Front-end page
The Code is as follows:
$. Ajax ({Type: "post ",ContentType: "application/json ",Url: "../WebForm1.aspx/GetRightsStr ",DataType: "json ",Success: function (msg ){Alert (msg.
In ajax interaction, the data types returned from the server include xml, html, script, json, jsonp, and text. This document uses json as an example, this section describes how to use jquery to traverse the two json data structures at the front end
Code is implemented based on the Jquery and WebMethod voting functions. For more information, see.
1: Function Description
1) it is best to have several stars. when voting, users can click the stars to vote and customize the number of stars.
2) If
After finding a time to read the EasyUI plug-in, I felt comfortable with the plug-in. I made a summary of most of the functional attributes of EasyUI. Friends who use easyUI can add them to their favorites. For more information about jQuery EasyUI 1.
Grid gets a Summary of the method for selecting row data. For more information, see.
The Code is as follows:
Grid. getStore (). getRange (0, store. getCount (); // obtain all rows of the grid.
The Code is as follows:
Grid. getSelectionModel (
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