与jQuery.param()相反[重复]

时间:2022-02-10 12:13:18

This question already has an answer here:

这个问题在这里已有答案:

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

如果使用$ .param()序列化对象,我该如何获取它?

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

在PHP中有parse_str但我没有在javascript中找到任何类似的东西。

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

TL&DR:事实证明parse_str已被移植到javascript:http://phpjs.org/functions/parse_str/

2 个解决方案

#1


2  

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

检查一下:Javascript / Jquery:$ .param()反函数。

You can also go for Deserializer of Jquery.

你也可以去Jquery的Deserializer。

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

jquery.deserialize是一个非常简单的jQuery插件,为表单元素提供“反序列化”功能。

#2


-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.

不确定它是否包含在jquery中,但请查看http://www.json.org。有可以使用的文件并执行JSON.parse()。我认为firefox本身就支持它,但我不认为IE会这样做。

#1


2  

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

检查一下:Javascript / Jquery:$ .param()反函数。

You can also go for Deserializer of Jquery.

你也可以去Jquery的Deserializer。

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

jquery.deserialize是一个非常简单的jQuery插件,为表单元素提供“反序列化”功能。

#2


-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.

不确定它是否包含在jquery中,但请查看http://www.json.org。有可以使用的文件并执行JSON.parse()。我认为firefox本身就支持它,但我不认为IE会这样做。