【发布时间】:2016-02-04 07:50:15
【问题描述】:
下面是我的 JSON 字符串
{
"cols": [{
"type": "string",
"id": "Date",
"label": "Date"
}, {
"type": "string",
"id": "Tweet",
"label": "Tweet"
}, {
"type": "number",
"id": "Retweets",
"label": "Retweets"
}, {
"type": "number",
"id": "Favorites",
"label": "Favorites"
}],
"rows": [{
"c": [{
"v": "<a href='' target='_blank'>14 Jan 2016 10:36PM</a>"
}, {
"v": "@sammaanchhabra\ We\ would\ like\ to\ assure\ u\ that\ we\ haven''t\ changed\ anything\ related\ to\ weight\.\(1/2\)"
}, {
"v": 0
}, {
"v": 1
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>14 Jan 2016 10:35PM</a>"
}, {
"v": "@sammaanchhabra\ We\ have\ kept\ these\ entities\ same\ as\ they\ were\ when\ we\ exited\ the\ market\.\ \(2/2\)"
}, {
"v": 0
}, {
"v": 0
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>14 Jan 2016 11:56AM</a>"
}, {
"v": "@RishutaKarthikD\ You\ can\ surely\ cook\ MAGGI\ Noodles\ in\ 2\ minutes\ by\ following\ the\ suggested\ method\ of\ preparation,\ as\ mentioned\ on\ pack\."
}, {
"v": 0
}, {
"v": 0
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>13 Jan 2016 07:39PM</a>"
}, {
"v": "@BTofficiel\ It''s\ good\ to\ be\ back!\ Enjoy\ your\ MAGGI\ Noodles\ :\)"
}, {
"v": 1
}, {
"v": 0
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>13 Jan 2016 07:05PM</a>"
}, {
"v": "@_clue_less\ we\ missed\ you\ too\ :\)\ Thank\ you\ for\ all\ the\ love\ and\ support\."
}, {
"v": 0
}, {
"v": 1
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>13 Jan 2016 01:08PM</a>"
}, {
"v": "@AakashRoyDC\ Thanks\ for\ your\ love\ !\ Delighted\ to\ have\ fans\ like\ you\."
}, {
"v": 0
}, {
"v": 1
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>13 Jan 2016 11:55AM</a>"
}, {
"v": "@AninBanerjeeeee\ \ In\ the\ initial\ phase\ we\ are\ rolling\ out\ MAGGI\ Noodles\ Masala,\ the\ most\ popular\ variant\ amongst\ our\ consumers\.\ \(1/2\)"
}, {
"v": 0
}, {
"v": 0
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>13 Jan 2016 11:54AM</a>"
}, {
"v": "@AninBanerjeeeee\ \ \ We\ will\ roll\ out\ some\ of\ our\ other\ variants\ as\ soon\ as\ possible\.\ \(2/2\)"
}, {
"v": 0
}, {
"v": 0
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>13 Jan 2016 11:18AM</a>"
}, {
"v": "@shrutideb\ \ We\ are\ concerned\ and\ would\ like\ to\ talk\ to\ you\ &\ investigate\.\ Please\ DM\ your\ contact\ and\ location\ details\."
}, {
"v": 0
}, {
"v": 0
}]
}, {
"c": [{
"v": "<a href='' target='_blank'>12 Jan 2016 11:09PM</a>"
}, {
"v": "@Chethan14802058\ We\ are\ in\ touch\ with\ our\ channel\ partners\ and\ distributors\.\ \nThey\ are\ enthusiastic\ about\ the\ re-introduction\ of\ MAGGI\ \(1/2\)"
}, {
"v": 0
}, {
"v": 1
}]
}]
}
当我将变量 strJSON 中的 JSON 传递给
var data = new google.visualization.DataTable(strJSON);
它给了我错误JavaScript runtime error: Invalid JSON string:。我已经在 jsonlint 上验证了上面的 JSON,但是 google js 给出了错误。
【问题讨论】:
标签: javascript c# json charts google-visualization