Skip to content

Instantly share code, notes, and snippets.

@asawilliams
Created June 6, 2012 23:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asawilliams/2885370 to your computer and use it in GitHub Desktop.
Save asawilliams/2885370 to your computer and use it in GitHub Desktop.
chnages the format of a serialized object to use dot notation instead of brackets
// params is serialized object
params.replace(/%5B([a-zA-Z]+)%5D/g, '.$1');
@AlexByte
Copy link

AlexByte commented Jun 2, 2017

Thanks! $httpParamSerializerJQLike is stupid, custom function rocks.
$.param(object).replace(/%5B([a-zA-Z]+)%5D/g, '.$1');
It's important to transform in Spring MVC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment