Bug Tracker

Modify

Ticket #2890 (closed enhancement: fixed)

Opened 6 years ago

Last modified 4 years ago

Ajax.HttpData should examine response content-type for data evaluation

Reported by: mnichols Owned by:
Priority: major Milestone: 1.2.4
Component: ajax Version: 1.2.3
Keywords: httpData dataType dynamic Cc:
Blocking: Blocked by:

Description

The current implementation requires the user to explicitly state 'script' or 'json' for jq to evaluate the responseText. Since the method is currently inspecting the response content-type property for xml handling it should also do this for /script/ and /json/ dataTypes without requiring user explicit property setting. Why? Sometimes the server might return a script and other times raw html, so this would allow the server some flexibility. I have attached a patch that follows the same semantics as xml handling.

Attachments

ajax.httpData Download (876 bytes) - added by mnichols 6 years ago.
Implements similar semantics for all dataTypes not html

Change History

Changed 6 years ago by mnichols

Implements similar semantics for all dataTypes not html

comment:1 Changed 6 years ago by mnichols

Looks like #2733 is similar...except mine has a patch :)

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to fixed

Fixed via #5718.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.