解析JSON数据不包括引号与jQuery引号、不包括、数据、JSON

由网友(割接你的伤痛〃)分享简介:我试图解析JSON与jQuery我从通过AJAX远程服务器获取。 JSON数据是这样的: {标识符:ID,标签:标签} 却无力。显然,该领域标识符和标签没有双引号。它的工作原理时,在我的本地测试网站用双引号进行测试。 I'm trying to parse JSON with jQuery I get from a...

我试图解析JSON与jQuery我从通过AJAX远程服务器获取。 JSON数据是这样的: {标识符:ID,标签:标签} 却无力。显然,该领域标识符和标签没有双引号。它的工作原理时,在我的本地测试网站用双引号进行测试。

I'm trying to parse JSON with jQuery I get from a remote server through AJAX. The JSON data is like: {identifier:"ID", label:"LABEL"} but unable to. Apparently, the field identifier and label has no double quotes. It works when tested on my local test site with double quotes.

可不可以这样做没有引号用jQuery工作?我已搜查四周,没有发现任何解决方案。

Can it be made to work without quotes with jQuery? I have searched around and have found no solutions.

任何输入AP preciated。谢谢你。

Any input is appreciated. Thanks.

推荐答案

您不能。 JSON规范是:

You can't. JSON specification says this:

A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.

含义字符串作为你提到的标签。

Meaning string as the label you mention.

来源: http://www.json.org/

阅读全文

相关推荐

最新文章