Bug Tracker

Opened 11 years ago

Closed 11 years ago

#12234 closed bug (fixed)

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


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 (4)

comment:1 Changed 11 years 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 11 years 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"


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

comment:3 Changed 11 years ago by jaubourg

Component: unfiledajax
Milestone: None1.8.1
Owner: set to jaubourg
Priority: undecidedhigh
Status: newassigned

comment:4 Changed 11 years ago by jaubourg

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.