I need to retrieve data which is in XML format from a remote server. The data is opened to the public, so no restrictions.
Here is my code:
Ext.define('myApp.store.configStore', {
extend: 'Ext.data.Store',
requires: 'myApp.model.Config',
autoLoad: true,
storeId: 'ConfigStore',
proxy: {
type: 'ajax',
url: 'http://webtrak.bksv.com/mel/configuration',
reader: {
type: 'xml',
record: 'airport',
rootProperty: 'config'
}
}
});
But I am not able to get anything.
I cannot test it in browsers as the reason:
> "No 'Access-Control-Allow-Origin' header is present on the requested
> resource. Origin 'http://localhost:1991' is therefore not allowed
> access."
But if I test it in mobile phone, then I cannot get any error messages. So which means basically it's really hard to debug the app, I have to reply on guessing all the time which is really painful.
I am seeking a code example if possible. I found a fantastic place to test code:
Response to possible duplicate
I do not think my question is same as the mentioned question, there are 2 reasons:
that question is asking about how to overcome the CORS problem and we all know that from a website, you cannot retrieve data from another website(B) which has different domain unless B has specifically configured its website to allow other to access its data. But in my case, the Cordova/SenCha Touch generated app doesn't have the http protocol when requesting, so it's not the same problem.
I want to know how to do the ajax call in SenCha Touch, but don't know where to put in the ajax call code; but in that post/question developers can put that ajax call code in anywhere which is not my case.