I don't understand how to get information from another domain in Sencha Touch. I want to fill my store with data retrieved from a javascript, that got the information from another webservice.
For a test, I wrote following code in simpleTest.js:
function hello(){
"test":[{ "text": "hello"}];
}
And the store looks like this:
Ext.define("AccessibleMap.store.Teststore", {
extend: "Ext.data.Store",
config: {
model: "AccessibleMap.model.Testmodel",
autoLoad: true,
proxy:{
type: 'jsonp',
url: 'http://test.accessiblemap.square7.ch/live%20access/scripts/simpleTest.js',
reader:{
type : 'json',
rootProperty : 'test'
}
}
}
});
The error message shows, that it can't find the page.
Uncaught SyntaxError: Unexpected token : simpleTest.js:2
The problem seems to be the callback. How can I fix this?
How can I create a callback in javascript? Do I need to stringify the returning string to with json?