jaquin
22 Sep 2010, 1:56 AM
Hi,
I am trying to access the REST API of a website given the url, login name and password passed as parameters. If passed through the JSON request, a callback alert shall be prompted.
All I want to know is how can I retrieve the session Id but it returns this error "Uncaught SyntaxError: Unexpected token "
here is the sample of the code:
var makeJSONPRequest = function() {
Ext.util.JSONP.request({
url: 'http://www.site.com/rest/api/login',
callbackKey: 'callback',
params: {
loginName:'username',
password:'password',
},
callback: function(result) {
Alert('this must occur if method is passed.');
}
})
};
I am trying to access the REST API of a website given the url, login name and password passed as parameters. If passed through the JSON request, a callback alert shall be prompted.
All I want to know is how can I retrieve the session Id but it returns this error "Uncaught SyntaxError: Unexpected token "
here is the sample of the code:
var makeJSONPRequest = function() {
Ext.util.JSONP.request({
url: 'http://www.site.com/rest/api/login',
callbackKey: 'callback',
params: {
loginName:'username',
password:'password',
},
callback: function(result) {
Alert('this must occur if method is passed.');
}
})
};