-
Notifications
You must be signed in to change notification settings - Fork 475
Description
I was browsing through the Learning Centers Ajax-sections while creating other jQuery Ajax-related learning material and these few things seemed weird to me.
In the Key Concepts section there's this phrase:
I am a strong proponent of using the JSON format in most cases, as it provides the most flexibility. It is especially useful for sending both HTML and data at the same time.
and in jQuery's Ajax-related methods there's this:
I generally use the $.ajax() method and do not use convenience methods. As you'll see, it offers features that the convenience methods do not, and its syntax is more easily understandable, in my opinion.
Who's "I" (I assume that they are left overs from the jqFoundation Legacy)? While the opinions are nice, shouldn't they be formatted more formally if they are de-facto way of doing things? The differences why one should use $.ajax()-method over the convenience methods is explained later on in the Convenience Methods-section which makes the second phrase kind of moot anyway.
The first phrase in the Convience Methods-section, however, says this:
If you don't need the extensive configurability of $.ajax(), and you don't care about handling errors...
Handling the errors point is kinda misleading, as of jQuery 1.5. all jQuery Ajax-methods return a jqXHR-object, which is chainable with .error(), .done() and .always() (or as of 1.8 with .fail(), .done() and .always()), which makes using the convenience methods while handling error situations possible.