从json对象中删除引号

时间:2010-11-22 07:21:47

标签: javascript jquery json

如何从json对象中删除引号:

使用php,我得到以下格式的数据(使用console.log()显示数据)

[
    ["Catching the Wind in Rural Malawi § SEEDM...", "3"], 
    ["Engineering § SEEDMAGAZINE.COM...", "2"], 
    ["Technology Review India: Nissan's Lea...", "2"], 
    ["Alternative Fuel Consulting & Technical Tr...", "2"], 
    ["MIT OpenCourseWare | Science, Technology, ...", "2"]
]

如何使用jquery / json删除引号,我需要这样的字符串(数字周围没有引号):

[
    ["Catching the Wind in Rural Malawi § SEEDM...", 3], 
    ["Engineering § SEEDMAGAZINE.COM...", 2], 
    ["Technology Review India: Nissan's Lea...", 2], 
    ["Alternative Fuel Consulting & Technical Tr...", 2], 
    ["MIT OpenCourseWare | Science, Technology, ...", 2]
]

1 个答案:

答案 0 :(得分:5)

你没有。您解析JSON,将它们转换为整数,然后再次进行字符串化。