我有以下json对象:
{ "id": "109",
"No. of interfaces": "4" }
以下几行工作正常:
alert(obj.id);
alert(obj["id"]);
但是,如果键有空格,那么我将无法访问它们的值,例如
alert(obj."No. of interfaces"); //Syntax error
如何访问键名带有空格的值?可能吗?
相关分类