Skip to main content

Bug Tracker

Side navigation

#11915 closed bug (wontfix)

Opened June 14, 2012 09:59PM UTC

Closed June 14, 2012 10:35PM UTC

buildParams fails tries to serialize obj functions

Reported by: tiagomtotti@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
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;

.....

}

Attachments (0)
Change History (1)

Changed June 14, 2012 10:35PM UTC by rwaldron comment:1

resolution: → wontfix
status: newclosed

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