2013-09-01 4 views
0

Sencha Touch의 새로운 기능입니다. 웹 서비스를 사용하려고했지만 "제공된 구성을 사용하여 데이터를로드 할 수 없습니다. 브라우저에서 열기"라고 계속 말합니다. 내 가게Sencha Touch 2.2에서 웹 서비스를 사용하는 방법

Ext.define('MyApp.store.MyJsonPStore', { 
    extend: 'Ext.data.Store', 

    requires: [ 
     'MyApp.model.MyModel' 
    ], 

    config: { 
     autoLoad: true, 
     model: 'MyApp.model.MyModel', 
     storeId: 'MyJsonPStore', 
     proxy: { 
      type: 'jsonp', 
      url: 'http://api.twitter.com/1/statuses/public_timeline.json', 
      reader: { 
       type: 'json', 
       rootProperty: 'errors' 
      } 
     } 
    } 
}); 

하고 내 모델은 사전에 도움을

Ext.define('MyApp.model.MyModel', { 
    extend: 'Ext.data.Model', 

    config: { 
     fields: [ 
      { 
       name: 'message' 
      }, 
      { 
       name: 'code' 
      } 
     ] 
    } 
}); 

감사합니다.

+0

코드에서 URL을 따라 가면 "Twitter REST API v1이 더 이상 활성화되지 않습니다"라는 JSON으로 응답합니다. –

+0

예하지만 JSON 응답을 제공합니다. 또한 http://bitcoincharts.com/t/markets.json을 사용해 보았습니다. 같은 오류로 끝납니다. – Joseph

+0

이 답변을보고 싶을 수도 있습니다. http://stackoverflow.com/questions/5359224/parsererror-after-jquery-ajax-request-with-jsonp-content-type/5359239#5359239 –

답변

0

Ext.define ('MyApp.store.MyJsonPStore'{ 는 연장 'Ext.data.Store를'

requires: [ 
    'MyApp.model.MyModel' 
], 

config: { 
    autoLoad: true, 
    model: 'MyApp.model.MyModel', 
    storeId: 'MyJsonPStore', 
    proxy: { 
     type: 'jsonp', 
     /*url: 'http://api.twitter.com/1/statuses/public_timeline.json',*/Url not valid 
     reader: { 
      type: 'json', 
      rootProperty: 'errors' 
     } 
    } 
} 

});

+0

URL을 사용해 보았습니다. 'http : //bitcoincharts.com/t/markets.json '오류는 동일하게 유지됩니다. – Joseph