Side navigation
#9565 closed enhancement (worksforme)
Opened June 11, 2011 11:22PM UTC
Closed June 12, 2011 02:23AM UTC
Last modified June 12, 2011 10:13AM UTC
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
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
Attachments (0)
Change History (4)
Changed June 12, 2011 01:34AM UTC by comment:1
component: | unfiled → ajax |
---|---|
description: | I have a global ajax event handler in my app and I was very surprised when I could 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 → 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 |
Changed June 12, 2011 02:23AM UTC by comment:2
priority: | undecided → low |
---|---|
resolution: | → worksforme |
status: | new → closed |
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.
Changed June 12, 2011 02:24AM UTC by comment:3
Example: http://jsfiddle.net/dmethvin/cXAr4/
Changed June 12, 2011 10:13AM UTC by comment:4
10x I didn't know that :)