Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9565 closed enhancement (worksforme)

Add ajax request type to the xhr object

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Rick Waldron)

I have a global ajax event handler in my app and I was very surprised when I couldn't find out the request type (get/post/delete and so) from the xhr object which is passed to the callback.

I have searched the documentation, but I couldn't find good solution. And I think that adding such property to the xhr object itself won't be very hard

Change History (4)

comment:1 Changed 9 years ago by Rick Waldron

Component: unfiledajax
Description: modified (diff)

comment:2 Changed 9 years ago by dmethvin

Priority: undecidedlow
Resolution: worksforme
Status: newclosed

By default, the this object of the ajax callbacks is $.ajaxSettings combined with the argument to $.ajax which would have the type passed into the method, if any. (The default type is GET.) I've updated the docs to clarify.

comment:4 Changed 9 years ago by anonymous

10x I didn't know that :)

Note: See TracTickets for help on using tickets.