After attempting to query my Solr server with the provided code snippet:
var url ="http://localhost:8080/solr/sdc/selectwt=json&callback=JSON_CALLBACK&q=opioid"
$http.jsonp(url ).success(function(res){
console.log(res)
})
An error is returned in the console:
select?wt=json&callback=angular.callbacks._0&q=opioid:formatted:1
Uncaught SyntaxError: Unexpected token :
The response output displays as follows:
{"responseHeader":{"status":0,"QTime":0,"params":{"q":"opioid","callback":"angular.callbacks._0","wt":"json"}},"response":{"numFound":28,"start":0,"docs": ........
This issue seems to be related to the format of the Solr response, particularly the first occurrence of :
I'm unsure if I have a strong grasp on what jsonp entails to troubleshoot effectively. Furthermore, using JSONP may come across as unorthodox. Is it considered safe for use within a corporate setting?