most useful functions in jquery
This Blog deals with the Quick look at the seven jQuery AJAX functions, That deal directly with AJAX transactions which are made to a remote server.
jQuery.get() :
This function is the most generic of jQuery tools. It does a simple HTTP GET request from the server. The data that is passed into the callback function is in the form of a string. We used this function in the previous chapter and we will use it in the next project we do. There is a variation of this function, jQuery.getIfModified(), that does the same thing, but only invokes the callback if the returned document has changed since it was last loaded by this script.
jQuery.getJSON() :
This function works like jQuery.get() with one difference. The returned data is treated like JSON data and is parsed into JavaScript objects. If you try to get XML content with this function, it will generate an error.
jQuery.getScript() :
This function also works like jQuery.get(), except that it expects that the returned data will be JavaScript. The script is loaded and interpreted as soon as the AJAX request completes.
jQuery.post() :
This function does an HTTP POST, instead of using an HTTP GET. This function is good for posting form data, or sending messages that would result in changes on the server. From the programmer's perspective, it works like jQuery.get().
jQuery.ajax() :
The other functions are "high level." Simply call the function, and it takes care of all of the details of an AJAX transaction. Sometimes, you may want greater control over the details. This function gives you access to more of the details of the AJAX call, including access to the XMLHttpRequest object. (Note: it is fully documented at http://jQuery.com.
$('#id').load() :
This function provides even more functionality than the others. It retrieves HTML content from a remote server, and then injects it right into the DOM(css id or class) for you. The other jQuery methods are called from the main jQuery object. This one requires an instance of a jQuery object to know where to insert the content. For example, to insert content into the first paragraph of the document, we could do something like this: $('p:first').load(myUrl). There is also a variation of this function, $(o).loadIfModified(), which does the same thing only if the remote document has been modified since the last time this function was called.
most useful functions in jquery, Romel Drupal, most popular equivalent in jQuery, romel jquery, jquery romel, javascript romel, romel javascript, javascript, jquery
Not for studies :Itz a real pleasure to work with jquery
jQuery.get() :
This function is the most generic of jQuery tools. It does a simple HTTP GET request from the server. The data that is passed into the callback function is in the form of a string. We used this function in the previous chapter and we will use it in the next project we do. There is a variation of this function, jQuery.getIfModified(), that does the same thing, but only invokes the callback if the returned document has changed since it was last loaded by this script.
jQuery.getJSON() :
This function works like jQuery.get() with one difference. The returned data is treated like JSON data and is parsed into JavaScript objects. If you try to get XML content with this function, it will generate an error.
jQuery.getScript() :
This function also works like jQuery.get(), except that it expects that the returned data will be JavaScript. The script is loaded and interpreted as soon as the AJAX request completes.
jQuery.post() :
This function does an HTTP POST, instead of using an HTTP GET. This function is good for posting form data, or sending messages that would result in changes on the server. From the programmer's perspective, it works like jQuery.get().
jQuery.ajax() :
The other functions are "high level." Simply call the function, and it takes care of all of the details of an AJAX transaction. Sometimes, you may want greater control over the details. This function gives you access to more of the details of the AJAX call, including access to the XMLHttpRequest object. (Note: it is fully documented at http://jQuery.com.
$('#id').load() :
This function provides even more functionality than the others. It retrieves HTML content from a remote server, and then injects it right into the DOM(css id or class) for you. The other jQuery methods are called from the main jQuery object. This one requires an instance of a jQuery object to know where to insert the content. For example, to insert content into the first paragraph of the document, we could do something like this: $('p:first').load(myUrl). There is also a variation of this function, $(o).loadIfModified(), which does the same thing only if the remote document has been modified since the last time this function was called.
Not for studies :Itz a real pleasure to work with jquery
Comments