Bug Tracker

Opened 11 years ago

Closed 10 years ago

#3775 closed bug (duplicate)

$.get() doesn't shift 'type' argument when 'data' argument is omitted

Reported by: Wim Leers Owned by: aflesler
Priority: minor Milestone: 1.4
Component: ajax Version: 1.3.1
Keywords: get Cc:
Blocked by: Blocking:

Description

callback is shifted, but type isn't.

Attachments (1)

get_arguments.patch (370 bytes) - added by Wim Leers 11 years ago.

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by Wim Leers

Attachment: get_arguments.patch added

comment:1 Changed 11 years ago by dmethvin

Owner: set to aflesler

Looks like a good fix.

comment:2 Changed 11 years ago by john

Milestone: 1.31.3.2
Version: 1.2.61.3.1

I think this is OK, though - the type argument isn't meant to be used by external developers (it's for internal uses, only). Actually, it should probably just be removed outright.

comment:3 Changed 11 years ago by dmethvin

Also, it's tricky to shift the parameters because getScript and getJSON always pass the type as the fourth arg even if not all the args are provided.

Maybe we just need the docs to clarify that if an arg is left out it should be replaced with a null rather than shifting down the subsequent args.

comment:4 Changed 11 years ago by dmethvin

See duplicate #4384 for a patch that can be applied if this functionality is not removed. Note that $.get and $.post publicly document that type is a parameter so I'm not sure it can be removed at this point without heartache.

http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype

http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype

comment:5 Changed 11 years ago by paul.irish

This ticket is a dupe of #2452 which has a patch that'll fix both $.get() and $.post()

comment:6 Changed 10 years ago by yehuda

Milestone: 1.3.21.3.3

comment:7 Changed 10 years ago by flesler

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.