I am sending a http POST request to a php file (located in another host), using ajax, inside a JavaScript file hosted at 000webhost.com.
Even though I can see that the php file at the other host gets my request and acts accordingly, my script believes that the request failed and moves to the fail(function()
part of the code.
Could this be a problem with my host?
Here is the code:
$.ajax({
url: 'MyURL',
data: 'MyData',
type: 'POST',
dataType: 'json'
}).done(function(jqxhr){
//Part which I want to be executed.
}).fail(function(){
//Part which that is executed.
}).always(function(){
});