I m having trouble getting a cross domain request to work with jQuery and can t seem to figure out what s going on. Basically I m trying to query a Solr server and neither the success or error functions are being called. When in the Javascript console for Chrome I do not get any sort of error. Also, when I only type in "mysolrserver/?wt=json&q=title:uw" into the url bar I get a json formatted string.
I replaced my ip with "mysolrserver". Thank you in advance!
My javascript file:
"use strict";
(function() {
window.onload = function(){
document.getElementById("search").onclick = request;
}
function request(){
$.ajax( mysolrserver/?wt=json&q=title:uw , {
dataType: jsonp ,
success: function(data){
alert("Success");
},
error: function(error, data, type){
alert(data + ": " + type + "."); //type isn t giving any response.
}
});
}
})();
Update:
In the json response I get from the server, the beginning section is this (I ommited the response section because it s return a ton of text): {"responseHeader":{"status":0,"QTime":2,"params":{"q":"title:uw","callback":"jQuery1102035263595171272755_1383771206800","_":"1383771206801","wt":"json"}},"response":
So I assume you re meaning this: "callback":"jQuery1102035263595171272755_1383771206800"