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 Fida
  • 3,634
  • 3
  • 28
  • 29
  • The other question is related to a serialized form, i'm talking about objects here... – Florian Fida 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 Fida 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
  • 51,864
  • 34
  • 134
  • 163
-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,015
  • 5
  • 44
  • 59