2012-01-04 130 views
0

我想通过一个Web服务器传递一个JSON对象给Enyo。 文件从服务被加载Enyo:如何通过Web服务将JSON对象传递给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(); 
}, 

当我点击inReply我铬调试它说

Object: 
Comments: Array[3] 

怎么说它没有定义,如果观察窗口显示为

Object: 
Comments: Array[3] 

回答

2

您问题中的代码混合了InResponse(大写I)和inResponse(小写字母i)。假设这是您的真正代码是什么样子,改变

this.serverReply = InResponse; 

this.serverReply = inResponse; 
+0

AHHHH我怎么可能有薄雾,谢谢 – 2012-01-05 13:57:24

+1

接下来的时间,运行至[JSLint的(代码HTTP ://jslint.com)。它会发现这种错误,不需要问这个。 – 2012-01-05 14:11:31

相关问题