15

If you serialize a object with $.param() how do i get it back?

in php there is parse_str but i didn't find anything like it in javascript.

TL&DR: Turns out that parse_str has been ported to javascript:
http://phpjs.org/functions/parse_str/

Florian F
  • 4,044
  • 3
  • 30
  • 31
  • The other question is related to a serialized form, i'm talking about objects here... – Florian F Jun 09 '11 at 17:53
  • not sure why this is still closed, its not a duplicate (at least not to the linked question). Anyway, this is what i was looking for: http://phpjs.org/functions/parse_str/ – Florian F Dec 10 '13 at 17:02

2 Answers2

2

Check this : Javascript / Jquery: $.param( ) inverse function.

You can also go for Deserializer of Jquery.

jquery.deserialize is a very simple jQuery plugin providing 'deserialize' functionality to a form elements.

Community
  • 1
  • 1
Saurabh Gokhale
  • 53,625
  • 36
  • 139
  • 164
-3

Not sure if it's included in jquery, but look at http://www.json.org. There is file that you can use and do JSON.parse(). I think firefox has native support for it, but I don't think IE does.

ek_ny
  • 10,153
  • 6
  • 47
  • 60