添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
逆袭的打火机  ·  C# URL Encode (How It ...·  45 分钟前    · 
有腹肌的萝卜  ·  The ...·  昨天    · 
踏实的胡萝卜  ·  Sql ...·  2 天前    · 
强健的登山鞋  ·  Solved: Varchar date ...·  2 天前    · 
欢乐的甜瓜  ·  SQL Convert Date ...·  2 天前    · 
英勇无比的石榴  ·  Selenium can not find ...·  2 周前    · 
另类的香烟  ·  Best Men's Loungewear ...·  5 月前    · 
怕老婆的扁豆  ·  VS: ZERO_CHECK cyclic ...·  6 月前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I want to convert array to json object in js or jquery. Is there any function is available or lib

Thanks in advance

In modern browsers you can simply use JSON.stringify(someJSObject) to convert any JavaScript object (that includes arrays) to a JSON string.

To ensure it also works in less modern browsers, include https://github.com/douglascrockford/JSON-js/blob/master/json2.js on your page.

yes, your browser can't be 3 years old... If it is, it's not that difficult to create custom object->json parser ladar Jan 12, 2012 at 12:35 IE6 has about 1% share, so I don't really have to care about it. And I thought that IE8 has JSON support (with maybe some issues with callbacks). ladar Jan 12, 2012 at 13:08 I said IE 8 supports it. IE 7 doesn't. Between IE 7 and IE 8 you are talking about more than one in twenty users. (Usual provisos about browser stats apply). Quentin Jan 12, 2012 at 13:13 "Hit" not "Pass". The point in support an old browser is that more than 1 in 20 people use it. That's a lot of customers / advert views / whatever. Quentin Jan 12, 2012 at 13:31