0
我是移動應用程序開發的初學者。爲了從sencha開始,我遵循簡單的教程http://jbkflex.wordpress.com/2012/06/18/creating-a-simple-list-in-sencha-touch-2-0/由於404錯誤而無法加載移動應用程序,但存在文件
我設置了一個IIS文件夾,並添加了IIS AppPool\DefaultAppPool
用戶,完全擁有創建的Web應用程序的權限。
好吧,我完成了編寫代碼(模型,存儲和查看),但是當我試圖加載的HTML頁面,我有在Chrome以下錯誤:
GET http://localhost/test/data/contact.json?_dc=1365970529423&page=1&start=0&limit=25 404 (Not Found)
但是我有一個JSON文件: http://i.imgur.com/ANUS79C.png
爲什麼文件沒有加載?爲什麼只是404?
完整的完整的javascript代碼:
Ext.application({
name: 'Sencha',
launch: function() {
//creating our model
Ext.define('Contacts',{
extend:'Ext.data.Model',
config: {
fields:[
{name:'firstName' ,type:'string'},
{name:'lastName', type:'string'} ,
{name:'contactno', type:'string'},
{name:'address', type:'string'}
]
}
});
//creating our store
var contactStore = Ext.create('Ext.data.Store', {
model:'Contacts',
proxy:{
type:'ajax',
url:'data/contact.json',
reader:'json'
},
autoLoad:true
});
//console.log("Store: ", moviesStore.data);
//item template
var itemTemplate = new Ext.XTemplate(
'<tpl for=".">',
'{firstName} {lastName}',
'</tpl>'
);
//creating our List
var contactList = Ext.create('Ext.dataview.List',{
title: 'Contact List',
store: contactStore,
itemTpl: itemTemplate
});
//adding event to List
contactList.on("itemtap",function(dataView,index,target,record,e){
var first_name = record.data.firstName;
var last_name = record.data.lastName;
var contact = record.data.contactno;
var address = record.data.address;
Ext.Msg.alert("Contact: " + contact);
//console.log(record.data.firstName);
});
//adding List to Main UI - Tab Panel
Ext.create('Ext.tab.Panel',{
fullscreen:true,
items:[contactList]
});
}
});
檢查您是否可以在瀏覽器中訪問http://localhost/test/data/contact.json。 – sha