Category: Talk to the server with Ajax
-
Conclusion
Ajax is a key part of modern applications, and jQuery is no slouch in providing a rich set of tools for you to work with. For loading HTML content into DOM elements, the load() method provides an easy way to grab the content from the server and make it the content of any set of matched elements.…
-
Taking full control of an Ajax request
The functions and methods you’ve seen so far are convenient for many cases, but there may be times when you want to take control of all the nitty-gritty details into your own hands. For example, you may want to be sure that each time your Ajax request is performed, you’ll receive fresh data (that is,…
-
Making GET and POST requests
The load() method makes either a GET or a POST request, depending on how the request parameter data (if any) is provided, but sometimes you want to have a bit more control over which HTTP method gets used. Why should you care? Because your server may care. Web authors have traditionally played fast and loose with the GET and POST methods,…
-
The first phase of the Boot Closet commerce page
The load() method is tremendously useful when you want to grab a fragment of HTML to stuff into the content of an element (or set of elements). But there may be times when you either want more control over how the Ajax request gets made or need to do something more complex with the returned data in…
-
Loading content into elements
Perhaps one of the most common uses of Ajax is to grab a chunk of content from the server and stuff it into the DOM at some strategic location. The content could be an HTML fragment that’s to become the child content of a target container element, or it could be plain text that will…
-
Keeping track of progress
An XHR instance informs you of its progress through the ready state handler. This handler is established by assigning a reference to the function to serve as the ready handler to the onreadystatechange property of the XHR instance. Once the request is initiated via the send() method, this callback will be invoked numerous times as the request makes transitions…
-
Brushing up on Ajax
Although we’ll take a quick look at Ajax in this section, this isn’t intended as a complete Ajax tutorial or an Ajax primer. If you’re completely unfamiliar with Ajax (or worse, think that we’re talking about a dishwashing liquid or a mythological Greek hero), we encourage you to familiarize yourself with the technology through resources…
-
Talk to the server with Ajax
This lessons covers Ajax is one of the technologies that has heavily transformed the landscape of the web. The ability to make asynchronous requests back to the server without the need to reload entire pages has enabled a whole new set of user-interaction paradigms and made DOM-scripted applications possible. A few years after Microsoft introduced…