Bug Tracker

Modify

Ticket #11915 (closed bug: wontfix)

Opened 11 months ago

Last modified 11 months ago

buildParams fails tries to serialize obj functions

Reported by: tiagomtotti@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

the buildParams funcion , called by $.ajax, fails when you pass an object that contains functions. For eg:

var data = {

myProp:"hello", fnc : function(){

return;

}

}

$.post('url',{obj:data}, function(){});

it can be easily fixed by adding the following guard instruction:

function buildParams(prefix, obj, traditional, add) {

if (jQuery.type(obj) === "function") return;

.....

}

Change History

comment:1 Changed 11 months ago by rwaldron

  • Status changed from new to closed
  • Resolution set to wontfix

Param objects should only contain serialization safe values - JSON doesn't allow functions and JSON rules are the rules to follow.

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.