I've trying to communicate with JDoodle API Server using JavaScript (JQuery), but everytime it says, CORS error. But when I did the same using Java Servlets, it was perfectly working. I used axios, but it also says 'Network Error'. My function looks like this:
function x()
{
var dataJ = {
clientId: ''XXXXXXXXX,
clientSecret:'XXXXXXXXXX',
language:'PHP',
script:'',
versionIndex: '0'
};
$.ajax({
type:'POST',
url:'https://api.jdoodle.com/v1/execute/',
data: dataJ,
success: function(e)
{
console.log(e);
},
error: function(e)
{
console.log(e.statusText);
}
});
}