andvitiello
6 Oct 2012, 7:17 AM
I have built a web application using sencha touch 2. And therefore creating the whole infrastructure MVC. The client asks for the services to the server, that answers through json...in localhost everything is all right, but if I want to insert the server in a place and from the client to call the web application, the pages web is not released because the error Access-Control-Allow-Origin springs. How to overcome him/it, since my web application is a mvc?
here the source code that there is a request to client from server:
Ext.define('Twitter.store.Contacts', {
extend: 'Ext.data.Store',
config: {
model: 'Twitter.model.Contact',
autoLoad: true,
pageSize: 100,
clearOnPageLoad: false,
proxy: {
type: 'ajax',
url: 'http://server.render:9090/MVisualCRendServer/viewCommonClient.do'
},
reader: {
type: 'json',
successProperty: 'success',
root: 'tweet',
}
}
});
I cannot change this application through the proxy jsonp because I don't have a callback to send. The answer of the server is through a normal json.
here the source code that there is a request to client from server:
Ext.define('Twitter.store.Contacts', {
extend: 'Ext.data.Store',
config: {
model: 'Twitter.model.Contact',
autoLoad: true,
pageSize: 100,
clearOnPageLoad: false,
proxy: {
type: 'ajax',
url: 'http://server.render:9090/MVisualCRendServer/viewCommonClient.do'
},
reader: {
type: 'json',
successProperty: 'success',
root: 'tweet',
}
}
});
I cannot change this application through the proxy jsonp because I don't have a callback to send. The answer of the server is through a normal json.