Skip to main content

Bug Tracker

Side navigation

#12004 closed feature (fixed)

Opened July 02, 2012 09:08PM UTC

Closed November 28, 2012 11:16PM UTC

Last modified January 15, 2013 02:51AM UTC

Allow ajax.method as alias for ajax.type

Reported by: david71rj Owned by: dmethvin
Priority: low Milestone: 1.9
Component: ajax Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Suggestion to 1.9.

Can be better to rename the ajax.type to ajax.method? I generally read METHOD POST and not TYPE POST. ajax.dataType can be renamed to ajax.type, like TYPE SCRIPT, TYPE HTML, TYPE TEXT, ...

Attachments (0)
Change History (13)

Changed July 02, 2012 09:10PM UTC by rwaldron comment:1

While it's possible to add an alias, I doubt we'll be able to complete "rename" the property - it would break everything that used $.ajax

Changed July 03, 2012 04:43PM UTC by dmethvin comment:2

status: newopen

Agreed, I'd be good with an alias (and have expected it to be method in the past) but we can't just rename it.

Changed July 14, 2012 01:59AM UTC by dmethvin comment:3

component: unfiledajax

Changed September 09, 2012 01:10AM UTC by dmethvin comment:4

type: enhancementfeature

Bulk change from enhancement to feature.

Changed October 15, 2012 02:22PM UTC by jaubourg comment:5

The good approach is to keep using type internally but accept and consider method in the first place in the main ajax function:

options.type = options.method || options.type;

That way we can keep type internally and not break existing prefilters and transports.

Changed October 15, 2012 05:41PM UTC by timmywil comment:6

priority: undecidedlow
resolution: → wontfix
status: openclosed

It doesn't sound like this will get done.

Changed October 15, 2012 06:02PM UTC by timmywil comment:7

resolution: wontfix
status: closedreopened

Sorry, I'm +1 on aliasing type and method, just not switching type and dataType

Changed October 15, 2012 06:02PM UTC by timmywil comment:8

milestone: None1.9
status: reopenedopen
version: → 1.8.2

Changed October 15, 2012 06:06PM UTC by david71rj comment:9

Yeah, dataType is inviable just now, to not cause breaks.

Changed October 24, 2012 04:22PM UTC by farmdawgnation comment:10

I've opened a pull request for this on Github.

Changed November 26, 2012 05:29PM UTC by dmethvin comment:11

owner: → dmethvin
status: openassigned

Changed November 28, 2012 11:16PM UTC by Matt Farmer comment:12

resolution: → fixed
status: assignedclosed

Alias options.method to options.type. Fixes #12004.

Changeset: 081c4efcf7736433d2fb5702e7bd4f8616426af2

Changed January 15, 2013 02:51AM UTC by dmethvin comment:13

summary: Rename ajax.type to ajax.methodAllow ajax.method as alias for ajax.type