The example in this article describes the principle of DOM loading and event execution in jquery. Share to everyone for your reference. The specific analysis is as follows:
The interaction between JavaScript and HTML is handled by the events that
JS in:
Copy Code code as follows:
function Chooseone (CHK) {
First gets the collection object of the Chekcbox of the same name
var obj = document.getelementsbyname ("chk");
For (i=0 iTo determine if the I element in the Obj collection
Today encountered a problem with JS to solve IE6 support max-width,max-height, just started with the jquery method to achieve, but has been not to get the value of CSS, such as
Copy Code code as follows:
if ($.browser.msie &&
JSON (JavaScript Object notation) is a lightweight data interchange format that uses a completely language-independent text format and is an ideal data interchange format. Also, JSON is the native format of JavaScript, which means that processing
In JavaScript, you can use Try...catch for exception handling. For example:
Copy Code code as follows:
try {foo.bar ();} catch (E) {alert (e.name + ":" + E.message);}
At present, we may get the system anomaly mainly contains
Now the world's Universal Gregorian calendar (Gregorian calendar) has also undergone a long-term evolution of the process. First of all, we see that the Gregorian calendar is a fixed number of days per month: "Seven before the single big, eight
1. Create an array
Copy Code code as follows:
var array = new Array ();
var array = new Array (size);//Specify the length of the array
var array = new Array (item1,item2......itemn);//Create an array and assign a value
2,
One, the object inheritance in JS
There are three ways of inheriting in JS
1.js Prototype (prototype) Implementation inheritance
Copy Code code as follows:
2. Constructor implementation inheritance
Copy Code code as
How to allow users to enter the WAP mobile website URL when automatically jump to WAP site?WAP page automatic jump to achieve the way?How can I tell if a visitor is a mobile device access and automatically jump to a WAP page?Mobile phone
The code is very simple, the main idea is to parse the URL parameters to JS object, and then do add, delete, change, check the operation is very convenient ~, take notes here.
Copy Code code as follows:
var lg= (function (LG) {
var
In the case of data extracted from the database (especially descriptive information) containing special characters, There is an error when converting a JSON string into a JSON object using Json.parse. It is mainly double quotes, carriage return, and
First from the server side, bind the Drop-down list, the level two drop-down of the text name according to a certain rule plus the first level Drop-down ID.
Copy Code code as follows:
var options=new Array ();
$ (document). Ready
The principle of array sort method in JS is analyzed in this paper. Share to everyone for your reference. The specific analysis is as follows:
Recently in Baidu's project to use the array to sort, of course, the first natural thought of the array
Mobile phone number verification (13 opening and 158,159 beginning, total 11 digits)
Copy Code code as follows:
var re;
var Ss=document.getelementbyid (' TextBox3 '). Value;
Re=/^ (13[0-9]{9}) | (15[89][0-9]{8}) $/
if (Re.test
The ECMASCRIPT5 standard, published on December 3, 2009, brings a number of new ways to improve the operations of existing array arrays. However, these novel array methods are not really popular because of the lack of browsers supporting ES5.
Array
Today encountered jquery return JSON data, ie browser prompts to download the problem, when the data submitted after the return of the original JSON data, in the fire arc test Normal, but the Internet Explorer is always prompted to save, search on
This section describes how to read and write JSON file under JS, the code is very concise
function Funsave () {
var id = $ (' #testText1 ') [0].value;
var name = $ (' #testText2 ') [0].value;
var str = ' {mydata:[' + ' {ID: ' + ID + ', Name: ' +
Obviously this is a topic that has nothing to do with IE (except advanced IE), however, interested students should come together to realize the getter and setter in the ECMASCRIPT5 standard. In an object, the operation of the property or method,
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