Bug Tracker

Modify

Ticket #12234 (closed bug: fixed)

Opened 21 months ago

Last modified 21 months ago

the .load() method,when params is null, the ajax type will be "POST", but not be "GET"

Reported by: 102xing@… Owned by: jaubourg
Priority: high Milestone: 1.8.1
Component: ajax Version: 1.8.0
Keywords: Cc:
Blocking: Blocked by:

Description

The .load() method, when params is "null", the ajax type will be "POST", but it should be "GET"? when version 1.7.2, this type is "GET".

Change History

comment:1 Changed 21 months ago by jaredjacobs@…

This change also would have broken our site, were it not for our automation tests.

Workaround is to remove the null argument, changing calls like this:

$("#box").load(url, null, function() {...});

to this:

$("#box").load(url, function() {...});

comment:2 Changed 21 months ago by anonymous

Thing change will also break our site and is impractical to use workaround since there are third-party tools that use null as params.

The problem lies in typeof null == "object"

true

But the behaviour of .load used to test for boolean value of params

comment:3 Changed 21 months ago by jaubourg

  • Owner set to jaubourg
  • Priority changed from undecided to high
  • Status changed from new to assigned
  • Component changed from unfiled to ajax
  • Milestone changed from None to 1.8.1

comment:4 Changed 21 months ago by jaubourg

  • Status changed from assigned to closed
  • Resolution set to fixed

Calling load with null as the data parameter now properly issues a GET request, not a POST request. Unit tests added. Fixes #12234.

Changeset: b292c4c2df673d17d8c720e13d4d81ecae4ec499

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.