Bug Tracker

Opened 11 years ago

Last modified 10 years ago

#8653 closed bug

jQuery.param outputs "null" and "undefined" in the query string — at Initial Version

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.8
Component: ajax Version: 1.5.1
Keywords: 1.8-discuss Cc: dmethvin
Blocked by: Blocking:

Description

This ticket is a followup to the discussion in http://forum.jquery.com/topic/should-null-be-passed-in-query-strings-generated-by-jquery-param where I am using jQuery.ajax to send data to a web service.

Given

jQuery.param({"string":"foo","null":null,"undefined":undefined})

the output is

"string=foo&null=null&undefined=undefined"

which the server will interpret as the strings "null" and "undefined" rather than as empty values.

My expected output would be:

"string=foo&null=&undefined"

where null values are coerced to empty string, and undefined values have no value. (This is the behaviour in Prototype 1.7, which seems reasonable.)

Change History (0)

Note: See TracTickets for help on using tickets.