My code is this: I want to pass user name and password to a get request API which will return JSON Output. I am accessing the web services which is hosted in some other domain.
Ext.data.JsonP.request({
url: serviceUrl,
callbackKey: 'callback',
params: {
username: username,
password: password
},
success: function(response, opts){
var output = result.responseText;
var parsedJSON = Ext.JSON.decode(output)
if((parsedJSON.errorMessage)== null){
Ext.Msg.alert('Authenticated');
}
else{
Ext.Msg.alert('Not Authenticated');
}
},
failure: function (result, request) {
Ext.Msg.alert('Failure'+result.responseText);
}
});