Skip to content

incorrect comment about jQuery.ajax returning a Promise #33

Closed

Description

The async routing section on promises has a comment that states:

Note: jQuery AJAX methods return promises

This is incorrect. The jQuery API indicates $.getJSON and other low level methods return the jqXHR type. I think the code in this example should be updated with a modern example. This would avoid the overhead of teaching the potentially confusing history and semantics behind jQuery's request utilities.

Activity

  1. sivakumar-kailasam commented on May 10, 2018

    @sivakumar-kailasam
    Member

    Thanks for reporting this. Here's a comment from their api docs,

    This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise.

    We might have avoided mentioning the jqXHR object to avoid explaining the intricacies of jqXHR when we originally wrote that code block back in 1.x series of the guides.

    Closing this issue for now. Please feel free to open a separate issue/PR about modernizing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions