我在與加載煎茶店的問題。我店的聲明是這樣的:煎茶錯誤的XMLHttpRequest無法加載的http://本地主機....原產地空沒有被允許訪問控制允許來源
Ext.regModel('Car',{
idProperty: 'id',
fields: [
//'id', 'company', 'driver', 'carType','xCoordinate','yCoordinate'
{name: 'id', type: 'int'},
{name:'company', type:'string'} ,
{name:'driver', type:'string'},
{name:'carType', type:'string'},
{name:'xCoordinate', type:'int'},
{name:'yCoordinate', type:'int'}
]
});
var strr= new Ext.regStore({
id:'carStore',
model:'Car', //configuration option is the cars
proxy: {
type: 'ajax',
url: 'http://localhost:8080/A/carStore.html&callback=?',
reader: {
type: 'json',
root: 'carss'
},
},
autoLoad: true
});
而且我保持在列表中的商店:
CarManagementSystem.views.carList = new Ext.List({
id: 'carList',
store: 'carStore',
onItemDisclosure: function (record) {
var selectedCar = record;
CarManagementSystem.views.addNewCar.load(selectedCar);
CarManagementSystem.views.viewport.setActiveItem('addNewCar', { type: 'slide', direction: 'left' });
},
itemTpl: '<div class="list-item-id">{id}</div>' +'<div class="list-item-driver">{driver}</div>'
});
然而,當我試圖用我的JSON文件加載列表中,我得到這個錯誤:
的XMLHttpRequest無法加載http://localhost:8080/A/carStore.html&callback=?&_dc=1311751412006&limit=25。 Access-Control-Allow-Origin不允許Origin null。 煎茶觸摸-debug.js:7212
遺漏的類型錯誤:無法讀取的不確定
財產「長度」我讓我的JSON文件中的HTML格式,並將其保存在服務器上。我會很感激任何幫助。
謝謝!