转换一个多维的JavaScript数组JSON? [英] Convert a multidimensional javascript array to JSON?
本文介绍了转换一个多维的JavaScript数组JSON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是多维的JavaScript数组转换成JSON的最佳方式?
What is the best way of converting a multi-dimensional javascript array to JSON?
推荐答案
大多数流行的JavaScript框架有包括JSON实用功能。例如,jQuery有直接调用一个网址,并加载JSON结果为对象的功能:的http://文档。 jquery.com/Getjson
Most of the popular JavaScript frameworks have JSON utility functions included. For instance, jQuery has a function that directly calls a url and loads the JSON result as an object : http://docs.jquery.com/Getjson
不过,你可以从的JSON网站:
https://github.com/douglascrockford/JSON-js
然后,只需使用code和使用JSON.stringify()方法阵列上。
Then, simply include the code and use the JSON.stringify() method on your array.
这篇关于转换一个多维的JavaScript数组JSON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文