i try with this code it is possible to access get method but i wont to access post method so how can i do that
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['id', 'name', 'email']
});
var store = Ext.create('Ext.data.Store', {
model: 'User',
restful:true,
proxy: {
type: 'jsonp',
url: 'http://localhost:8080/testapp/userreg',
callbackKey: 'Callback'
},
headers: {
'Content-type': 'application/json',
'开发者_运维百科Accept': 'application/json'
}
});
store.load();
is there any way to post cross site data in extjs4
If you mean that you want to post data cross-domain...no, you can't. I know that with the new Javascript Api's (XMLHttpRequest2) it can be done but I don't know if that is an option for you right now.
try use jquery
$.ajax({
type: 'POST',
url : urlServer+'/ws/Login/',
xhrFields: {
withCredentials: true
},
scope: this,
dataType: 'json',
data:values,
timeout: 10000,
success: function(result, request) {
精彩评论