PrefaceI have been refactoring the front-end code of the project recently and have also referred to the best practices of various front-end code to make the front-end HTML, CSS, and Javacript code more standard-compliant and have better performance,
What is cross-OriginFor security reasons, JavaScript does not allow cross-origin calls to objects on other pages. However, security restrictions also bring a lot of trouble to inject iframe or ajax applications. Here we will simply sort out the
The source code is as follows:[Javascript]$. Fn. pager = function (pagerInfo ){Var recordCount = this. size ();If (recordCount Var currentPageIndex = 1, // The current surface. The default value is 1.PageCount = Math. ceil (recordCount/pagerInfo.
Extjs uses the model layer and ing to associate the corresponding object attributes.Ext. define ('business. model. businessRequest. brunitrulemodel ',{Extend: 'ext. data. model ',Fields: ['id', 'code', 'description', 'typename', 'type', {name:
1. Put it in the headThis method loads js Code before the page is manned. In this way, we cannot obtain webpage elements in the head because the webpage has not been loaded. Let's look at the example below, when we want to dynamically modify the
Recently, the project used the "select all" and "unselect all" operation.
I used to write my own JS files. now that you know how to write. so how can we use JQ to write more concisely. in this way, you can learn new things. if Baidu finds a good
When learning JQuery's asynchronous form submission, Chinese garbled characters may occur:
Currently, two solutions are available:
First, it is relatively earthy, that is, in the action, use
System. out. println (new String (this.
Activity. managedQuery ()Obtain a Cursor object containing the specified data and the Activity takes over the life cycle of the Cursor.First, this function obtains a Cursor object containing the specified data (specified by the query method
Recently, project tasks are heavy, and blog updates are slow, but you may wish to share your accumulated resources.JavaScript Regular Expressions (updated based on recent writes)1. Creation and usage of javascript Regular object replacement:/pattern/
@ Author YHC
You can create a dialog, toolbar, And button, and create a tag from HTML. This tutorial describes how to add toolbar and button to dialog without any javascript code.
Create a Dialog[Html]Toolbar = "# dlg-toolbar" buttons = "#
When a function is called, if a real parameter is omitted, the function automatically assigns a default value to the parameter, which greatly improves the convenience and flexibility of function calling.
For example, if the string truncation
Remember the animated dashboard javascript-gauge. js we shared at the front end. Using it can help us quickly build a superb animated dashboard.Today, we will introduce a javascript class library with better compatibility for the animation dashboard:
JavaScript sets a time validity period. I feel that the code is too concise when using jQuery. This is a piece of js code written by my colleagues. I learned it myself. untitled document
www.2cto.com within one day within two days within three
. Verify that the account is validVerification rules: a combination of letters, numbers, and underscores. It must start with a letter and contain 4-16 characters. ?FunctionCheckUser (str ){VarRe =/^ [a-zA-z] \ w {3, 15} $ /;If (re. test (str
In Extjs4, right-click the corresponding eventItemcontextmenu (Ext. view. View this, Ext. data. Model record,HTMLElement item, Number index, Ext. EventObject e, Object eOpts)You can directly add it to listeners for use:
[Javascript]Listeners
Constructor principlesJavaScript is an object-oriented language, but JavaScript does not have the concept of classes. JavaScript uses constructor to simulate the effect of the class, that is, we use the function to create objects. This also proves
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