Bug Tracker

Modify

Ticket #3775 (closed bug: duplicate)

Opened 4 years ago

Last modified 4 years ago

$.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:
Blocking: Blocked by:

Description

callback is shifted, but type isn't.

Attachments

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

Change History

Changed 4 years ago by Wim Leers

comment:1 Changed 4 years ago by dmethvin

  • Owner set to aflesler

Looks like a good fix.

comment:2 Changed 4 years ago by john

  • Version changed from 1.2.6 to 1.3.1
  • Milestone changed from 1.3 to 1.3.2

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 4 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 4 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 4 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 4 years ago by yehuda

  • Milestone changed from 1.3.2 to 1.3.3

comment:7 Changed 4 years ago by flesler

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

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.