When someone asked about the Forum and found it interesting, I tried to write it.
Script var getNewString = function () {var getIc = function (ic) {var arric = ic. split (","); randomIc = arric [Math. floor (Math. random () * (arric. length)];
Many websites are composed of form submissions, but verification is required for some submissions. The simplest method for client verification is to use JS custom functions. This document contains 28 common verification functions and several
The differences between static objects and constructors are usually in JSON format, or varobjfunction () {} or function () {} object construction methods, sometimes it is considered equivalent, but they are different. First look:
The Code is as
For front-end engineers, cross-browser compatibility has always been the biggest headache. To test a small thing, we need to open N browsers and compare and record the data of each browser, it is quite difficult to compare. as a standard lazy person,
Jquery is the most easy-to-use Form Verification plug-in. It is worth looking at both the application and the writing of the plug-in.
The Code is as follows:
/*Jquery Form Verification plug-inJanchie 2010.1 janchie@163.comVersion 1.01*/(Function ($
I didn't expect jquery to be updated so quickly this time. I haven't sent the jquery1.4 tutorial for two weeks, and jquery1.4.2 will be released. This jquery1.4.2 update mainly includes performance and new APIs. Performance: see
Download the latest
Extcombox is similar to the baidu search prompt. You must disable the paging function. View code
The Code is as follows:
Var comboxContractType = new Ext. form. ComboBox ({Name: 'logisticsid ',FieldLabel: 'logistics company ',DisplayField:
JavaScript code to implement zero padding:
The Code is as follows:
/* Quiet Method */Function pad (num, n ){Var I = (num + ""). length;While (I ++ Return num;}
The above code is too cool to reflect my real level. So there is implementation 2:
For more information about how to improve the performance of your for loop, see. The for loop is generally used to traverse arrays in javascript, as shown below:
The Code is as follows:
Var arr = [];For (var I = 0; I // loop}
The biggest problem
It is easy to determine whether a control has been loaded, that is, to use the browser's parsing sequence. In layman's terms, the higher the code is, the more loaded it is. For example:
The Code is as follows:
When parsing, the browser first
This is a very interesting question. Let's start with Object. prototype. toString to see if it can be solved.
Script alert (Object. prototype. toString. call (window) script [Ctrl + A select all Note: If you need to introduce external Js, You need
Anonymous functions can effectively control the scope of variables and construct Closure to prevent global variables from being contaminated. Compile anonymous functions in JavaScript using the following methods: Error Mode: syntax error warning
If the node in the tree structure is not the root or the last branch, it must have its parents and children. The DOM structure is also a Tree structure. The Tree selector provided by jQuery can be used to select nodes in the DOM Tree. The tree
HTML has some related elements with different tag names, such as H1-H6 or input, select and TEXTAREA. GetElementByTagName can only retrieve elements with the same tag name, so you cannot use it to retrieve all titles or the entire form content.
When creating the UI, I sometimes want to parse the search part of the url and install a practical method to share it with you.
The Code is as follows:
Function searchParse (){Var resultObj = {};Var search = window. location. search;If (search
The function of the toString method is needless to say. This built-in JavaScript method also has a feature: When executing some special methods, such as alert or innerHTML, it will be automatically called by the script parser. This feature obviously
A simple & amp; Tabs plug-in based on Jquery. For more information, see.
HTML code
The Code is as follows:
1
2
3
First
Second
Third
Jquery
The Code is as follows:
$ (). PPXTabs ({nav: '. tab Lil', nav_txt:'. tab_box P',
Through this article, you can get some implementation methods for JQUERY to operate JSON. 1. How does jqury use ajax to call the json data generated by the backend asp.net page?
2. jquery simple dom operations
3. Send a jquery development manual to
Improve your jQuery's 25 steps-there will be countless gains from the beginning, improving efficiency by thousands of times
1. Load jQuery from Google Code
Google Code has hosted a variety of JavaScript class libraries. Loading jQuery from Google
In the first chapter, I mentioned a problem that may not seem so understandable for the first time: "If an element and its parent element have an event handler for the same event, which of the following statements will be executed first?" There is
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