Author: admin
-
Events Methods
Category Method Description Form events blur Attaches or fires JavaScript “blur” event (when cursor go out from the input element). change Attach or fire JavaScript “change” event. focus Attach or fire JavaScript “focus” event. focusin Attach event handler for “focusin” event. select Attach or fire JavaScript “select” event. submit Attach or fire JavaScript “submit” event.…
-
Effect Methods
Method Description animate() Perform custom animation using element’s style properties. Example: $(‘#myDiv’).animate({ height: ‘200px’, width: ‘200px’}); clearQueue() Remove all the animations from the queue that have not been run. Example: $(‘#myDiv’).clearQueue(); delay() Set a timer to delay execution of animations in the queue. Example: $(‘#myDiv’).delay(5000); dequeue() Execute the next animation in the queue for the selected element. Example: $(‘#myDiv’).dequeue();…
-
DOM Traversing Methods
Method Description add() Creates a single jQuery object for all added elements, so that it will be easy to manipulate them at the same time. addBack() Creates a single jQuery object for the set of selected elements by selector. children() Get all the child elements of the selected element(s). closest() Traversing up through its ancestors…
-
DOM Manipulation Methods
Method Description append Inserts DOM elements at the end of selected element(s). appendTo Perform same task as append() method. The only difference is syntax. Here, first specify DOM elements as a string which you want to insert and then call appendTo() method with selector expression to select the elements where you want to append the…
-
Selector Reference
Selector Pattern Example Description Element $(‘div’) Selects all <div> elements :first $(‘div:first’) Selects first <div> element in a DOM hierarchy. :last $(‘div:last’) Selects last <div> element in a DOM hierarchy. Multiple elements $(‘p, div, code’) Selects <p>,<div> and <code> elements parent descendant $(‘div p’) Selects all <p> elements which is descendant of <div> parent child…
-
jQuery load() Method
The jQuery load() method allows HTML or text content to be loaded from a server and added into a DOM element. Syntax:$.load(url,[data],[callback]); Parameters Description: The following example shows how to load html content from the server and add it to div element. Example: Load HTML Content In the above example, we have specified html file…
-
jQuery post() Method
The jQuery post() method sends asynchronous http POST request to the server to submit the data to the server and get the response. Syntax:$.post(url,[data],[callback],[type]); Parameter Description: Let’s see how to submit data and get the response using post() method. Consider the following example. Example: jQuery post() Method Try it In the above example, first parameter…
-
jQuery get Method
The jQuery get() method sends asynchronous http GET request to the server and retrieves the data. Parameters Description: The following example shows how to retrieve data from a text file. Example: jQuery get() Method In the above example, first parameter is a url from which we want to retrieve the data. Here, we want to…
-
jQuery ajax() Method
The jQuery ajax() method provides core functionality of Ajax in jQuery. It sends asynchronous HTTP requests to the server. Syntax:$.ajax(url); $.ajax(url,[options]); Parameter description: The following table list all the options available for configuring Ajax request. Options Description accepts The content type sent in the request header that tells the server what kind of response it…
-
jQuery AJAX Introduction
AJAX stands for “Asynchronous JavaScript and XML”. JavaScript includes features of sending asynchronous http request using XMLHttpRequest object. Ajax is about using this ability of JavaScript to send asynchronous http request and get the xml data as a response (also in other formats) and update the part of a web page (using JavaScript) without reloading or refreshing…