Deserialize query string to JSON object

后端 未结 7 1261
感情败类
感情败类 2021-01-04 01:21

Tried to find how to make {foo:\"bar\"} from ?...&foo=bar&... but googled and got only to jQuery.params which does the opposit

7条回答
  •  渐次进展
    2021-01-04 02:11

    You have Ben Alman's jQuery BBQ and a jQuery.deparam in it. It is described as The opposite of jQuery.param, pretty much.

    http://benalman.com/code/projects/jquery-bbq/examples/deparam/

    First example is exactly what you need.

提交回复
热议问题