Throughout this chapter, we've revisited the basics, and explored some of the techniques we can use to take our knowledge of AJAX to the next level – the key being that it is not necessarily just about coding, but visiting some of those tips and tricks that help make us a more rounded developer.
In Working with Deferreds and Promises section, we explored the basics of using jQuery's Deferreds and Promises, and how the change in architecture when using them can lead to significant improvements in performance. Before we round up this chapter, there are some additional best practices that we should follow wherever possible. Following list explains them:
There is no need to call
.getJson()
or.get()
directly. These are called when using the$.ajax()
object by default.Don't mix protocols when calling requests. The preference is to use schemaless requests where possible.
If you are just making GET requests, try to avoid putting request parameters in the URL – instead...