2012-11-07 48 views
0
I'm trying to get some j son data from a local server using Senchatouch-2 app: 

我得到以下信息:的XMLHttpRequest不能與阿賈克斯加載一個URL Senchatouch-2

load http://localhost:8084/Sencha/senchatest. Origin http://localhost:8084 is not allowed by Access-Control-Allow-Origin. 

Even If I launch my sencha app as an, I get this: 

    XMLHttpRequest cannot load http://localhost:8084/Sencha/senchatest.Origin null is not allowed by Access-Control-Allow-Origin 

The web service returns data. I try to catch the data items like this: 

//動態列表視圖

proxy:{ 
      type: 'ajax', 
      method:'GET', 
      model:'List.model.Mainmodel', 
      url: 'http://localhost:8084/Sencha/senchatest', 

      reader: { 
       type: 'json', 
       rootProperty: 'data.firstName.lastName' 
       }} 

And I'm trying to get this structure: 
    {"data":[{"firstName": "dhina", "lastName": "karan"},{"firstName": "dhina", "lastName": "karan"},{"firstName": "dhina", "lastName": "karan"},{"firstName": "dhina", "lastName": "karan"},{"firstName": "dhina", "lastName": "karan"},{"firstName": "dhina", "lastName": "karan"}]} 

你知道爲什麼我得到這個錯誤?

感謝,

問候

回答

0

確保您通過服務器獲取你的頁面,而不是通過文件系統

+0

@radha你有沒有裝好了驗證這個? – Oxi