From the course: jQuery Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Convenience functions

Convenience functions - jQuery Tutorial

From the course: jQuery Essential Training

Start my 1-month free trial

Convenience functions

- [Instructor] Some types of Ajax operations happen fairly frequently in web development, and because of that jQuery provides a set of shorthand convenience functions to help make those operations as easy as possible. In this example we'll take a look at some of them. On the jQuery website let's click on the API Docs and then scroll down, and in the Ajax section I'm going to click on Shorthand Methods. jQuery provides some useful shorthand methods such as get and post for performing HTTP get and post requests. There's also a getJSON method for retrieving JSON data, and there's getScript for retrieving and then executing Javascript code. There's a load function which retrieves content and places it inside a page element. These shorthand functions make certain common types of Ajax requests easier to handle because they require you to write less code. So let's jump over to our exercise and take a look at some of these in action. So in your code open up Helpers_start.html. The structure…

Contents