jquery Common API

Source: Internet
Author: User

* one) jquery common method API combat
(1) Dom description and classification
A) DOM is a standard that is independent of the platform, language, and browser.
B) If you write your code exactly as the DOM standard in your project, you'll be able to manipulate the standard controls in the major mainstream browsers.
C) See <<>>

(2) jquery Operation Dom's common API combat
Father Append (son)
Father Prepend (son)
------------------------------
A.after (b): B after a
A.before (b): B before a
------------------------------
attr (Key,value) Setting property values
attr (key) Gets the property value
------------------------------
Val () Gets the Value property
Val (value) sets the Value property
------------------------------
$ ("HTML code") to create tags, text and attributes
------------------------------
Remove () deletes the element and its child elements
------------------------------
Old. ReplaceWith (new): New replacement old
------------------------------
HTML ()

CSS ()
------------------------------
Removeattr (): Delete property
------------------------------
Clone ()
Close (true)
------------------------------
AddClass ()
Hasclass ()
Removeclass ()
Toggleclass ()
------------------------------
Children () takes child elements regardless of descendant elements
Next () immediately following the sibling element
Prev () front adjacent to sibling element
Siblings () All of the sibling element collections can be traversed with each ()
------------------------------
Show () can be used for picture display
Hide ()
------------------------------
Slideup () Top slide
Slidedown () slipped
------------------------------

* II) jquery common event API combat
Window.onload Event:
A) executes when the page loads
B) If multiple onload events are written, the latter overrides the former
C) No shorthand form
$ (document). Ready () Event:
A) executes when the page loads
B) $ (document). Ready (processing function);
C) $ ();
Change ()
Select ()
Focus ()

Gets the event object generated by the browser, which requires no programmer code creation,
is generated by every browser, IE and Firefox browser generated events
The object can be different from the event object.
var code = Event.keycode;


KeyUp (): Left 37/Up 38/Right 39/Next 40
MouseMove ()
Mouseout ()
MouseOver ()
Submit ()

* three) jquery common Ajax-api Combat

(1) Get the current time of the server
jquery object. Load (url,senddata,function (BACKDATA,TEXTSTATUS,XHR) {...})
Load (): Send as Get if no parameter is involved
If there is a reference, send it by post

(2) Check whether the registered user name exists
$.get (Url,senddata,function (BACKDATA,TEXTSTATUS,XHR) {...})
$.post (Url,senddata,function (BACKDATA,TEXTSTATUS,XHR) {...})

(3) Two, level three menu linkage
$.post (Url,senddata,function (BACKDATA,TEXTSTATUS,XHR) {...})
Thinking: Linking menus into database versions

(4) JQuery object. Serialize ()
Ability to accept table parameters, form a JSON format string,
The premise is that you must take a Name property for each of the table items

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.