Reputation:
I simple make get req with ajax to elasticsearc to get all indices,
in browser it works here:
its same in my ajax, I expected the json data in browser return to my success method but failed:
Upvotes: 1
Views: 175
Reputation: 61
Response is not JSON,
you can change the response to a JSON in your server program.
Upvotes: 1
Reputation: 217474
It should work if you replace json
by jsonp
in your dataType parameter, like this:
$.ajax({
url: "http://localhost:9200/dicoms/dicoms/_search",
dataType: "jsonp", <--- change this
type: "GET",
success: function(data) {
...
});
Upvotes: 1