Source: http://www.ido321.com/1019.html
Ps:lz think this title is a bit big, beyond the scope of ability, do not like to touch. Currently only recorded in the LZ capacity within the range, and continue to supplement in the future.
One, the mutual transformation of jquery objects and Dom objects ("sharp jquery")
jquery into the DOM:
1, var JQ = $ (' #selector '); var dom = Jq[index];
2, var jq1 = $ (' #selector1 '); var dom1 = jq1.get (index) or var dom1 = Jq1.get () [index];
Dom translates to jquery:
Assuming that CR is a DOM object, convert to JQUERY,JQCR = $ (' cr ');
Two, jquery's $ (document). The difference between ready () and JavaScript's window.onload ("Sharp jquery")
1. Timing of implementation
Window.onload must wait for all resources (including pictures) in the Web page to be loaded before they can be executed, and $ (document). Ready () executes after all DOM structures have been drawn, but the resources that may be associated with the DOM have not yet been loaded.
2, write the number
In a document, Window.onload is only one, while $ (document). Ready () can have multiple
3. Simplified method
Window.onload no shorthand form, $ (document). Ready () can be abbreviated to $ (function () {}).
Third, the difference between the names of access attributes in jquery and JavaScript ("jquery Combat")
jquery Specification Name DOM Specification
CellSpacing cellspacing
Class ClassName
colspan colspan
Cssfloat IE is stylefloat, other browsers are cssfloat
Float IE is stylefloat, other browsers are cssfloat
For htmlfor
Frameborder frameborder
MaxLength MaxLength
ReadOnly ReadOnly
RowSpan rowspan
Stylefloat IE is stylefloat, other browsers are cssfloat
TabIndex TabIndex
Usemap Usemap
Iv. conflict
Dom does not theoretically conflict, and jquery prevents conflicts from two solutions: ("sharp jquery")
1. The jquery library is imported after other libraries
Call jquery. The Noconflict () method uses the control to another library, or a custom shortcut, $j = Jquery.noconflict ();
2. The jquery library is imported before other libraries
Use jquery directly instead of working, while $ can be used as a shortcut to other libraries.
Next article: MySQL extension for php: MySQL database overview
jquery notes: The connection and difference between jquery and JavaScript