无法在Sencha应用程序中解析json响应

时间:2013-05-19 09:45:28

标签: javascript html json sencha-touch-2

我想学习如何开发移动应用程序。所以我开始使用Sencha框架。

我从here下载了示例应用程序。当我从localhost应用程序运行时,我没有看到列表视图。

我没有修改代码。只需复制文件夹并在localhost中运行浏览器...

我希望来自:http://jbk404.site50.net/sencha/datahandling/

我收到了什么(Chrome中的警告):large picture

enter image description here

和index.html文件的头部结构:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sample test</title>
    <link href="resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />
    <script src="sencha-touch-all-debug.js" type="text/javascript"></script>
    <script src="app/app.js"></script>
</head>

我的错误在哪里?

1 个答案:

答案 0 :(得分:0)

我认为问题在于该示例使用的是旧版的sencha touch。如果您将JSON文件更改为此结构,它可能会起作用:

[ {
    "firstName": "Pearlie",
    "lastName": "White",
    "contactno": "011-9865460",
    "address": "365-Andrews Street, CA"
}]

希望它适合你,制作一个小提琴文件只需将代码复制到一个新的小提琴,它将工作。 http://new.senchafiddle.com/#/6aE31/

迎接

相关问题