0

我正在尝试使用 Web 服务器将 JSON 对象传递给 Enyo。从 Enyo 中的服务加载的文件:

{ "Comments" : ["NewComment 1", "NewComment 2", "NewComment 3"  ]}

该服务的以下回调会生成一条错误消息

gotComments: function(inSender, inResponse) {
    this.serverReply = InResponse; // error  uncaught reference error: inResponse not defined
     this.$.list.render();
},

当我在我的 chrome 调试器上单击 inReply 时,它说

Object:
Comments: Array[3]

如果监视窗口显示为

Object:
Comments: Array[3]
4

1 回答 1

2

您问题中的代码混合了InResponse(大写I)和inResponse(小写i)。假设这是您的真实代码的样子,请更改

this.serverReply = InResponse;

this.serverReply = inResponse;
于 2012-01-04T20:19:51.203 回答