This is my ajax call:
var myURL = ":1082/WEBSERVICE/getSellSheetData/v0.1";
muURL = myURL.normalize();
$.ajax({
url:myURL,
data: {
mode:"M",
group:"ML",
itemNumber:itemNumber.normalize(),
},
type: "GET",
dataType:"jsonp",
async:false,
jsonp:false,
})
.done(function(ob){
mgnPct = ob.margin;
logo = ob.custLogo;
mainImage = ob.mainImage;
})
.fail(function(xhr,ajaxOptions,thrownError){
if (xhr.status=="404") {
console.log(thrownError);
}
});
The console shows only "error".
Any ideas what I'm doing wrong.
When I execute this code, I can watch the API run in debug on my server and populate the output.
So I changed my code to this:
$.ajax({
url:myURL,
data: {
mode:"M",
group:"ML",
itemNumber:itemNumber,
},
type: "GET",
dataType:"jsonp",
async:true,
jsonp:false,
jsonpCallback:"processData",
error:function(xhr,ajaxOptions,thrownError) {
if (xhr.status=="404") {
console.log(thrownError);
}
},
success: processData,
});
function processData(ob) {
mgnPct = ob.margin;
logo = "http://example:8080/profoundui/images" + ob.custLogo;
mainImage = "/" + ob.mainImage;
}
Still getting the error 404. I'm getting very confused. I'm using JSONP to avoid CORS issues.