Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14374 closed feature (plugin)

$.param without serializing function results

Reported by: norman.pellet@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

Is it possible to add an option in $.param so that functions are purely and simply ignored from the serialization ?

Line 7499 (v1.10.2)

value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );

Currently, functions are executed and the result is serialized. In many case, the end-user simply wants the key/values of his native object to be serialized and functions left out.

Change History (1)

comment:1 Changed 6 years ago by dmethvin

Resolution: plugin
Status: newclosed

The documentation for $.param() explains that it calls the function and uses the return value. APIs that need additional arguments to modify their behavior get ugly really quickly. We already have the traditional argument there. This is a low-level method intended mainly for use by $.serialze(). If you have special needs just wrap it with your own method or use a better option like JSON.

Note: See TracTickets for help on using tickets.