We have our own Rest Webservices which returns JSON and we are able to consume(GET) data from browser as well as browser based rest client.
We have created a rest client which is JQuery (embeded in html) based and it is not able to even hit the webservices with same information using browser does. Below is code snippet. Only alert under 'error' getting called with status 0 and statusText blank.
$.ajax({
url: 'http://localhost:8080/appcontext/user/1234',
type: 'GET',
dataType: 'json',
success: function(data) {
alert('GET completed');
},
error: function(data) {
alert('GET failed STATUS ' + data.status );
alert('GET failed TEXT ' + data.statusText);
}
});
If I change dataType to jsonp then at least call goes to webservices but again goes to 'error' with status 200 and statuText load.
Please help where is the problem. Looks like no problem on webservices side as we can consume using other means like java code, browser etc. Problem with JQuery call.