Skip to main content

Bug Tracker

Side navigation

#12234 closed bug (fixed)

Opened August 10, 2012 05:32AM UTC

Closed August 16, 2012 02:46PM UTC

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

Reported by: 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".

Attachments (0)
Change History (4)

Changed August 10, 2012 10:01PM UTC by comment:1

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

Workaround is to remove the

argument, changing calls like this:

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

to this:

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

Changed August 13, 2012 03:23PM UTC by anonymous comment:2

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

Changed August 16, 2012 02:28PM UTC by jaubourg comment:3

component: unfiledajax
milestone: None1.8.1
owner: → jaubourg
priority: undecidedhigh
status: newassigned

Changed August 16, 2012 02:46PM UTC by jaubourg comment:4

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