I have a web page on my main web site ( that has an SSL certificate) and am trying to make an AJAX call to my local server (on my local machine with no SSL certificate.) Here is an extract of the code I am using :
function getSomeData (){
$.ajax({
url: 'http://?.?.?.?:2042/somefolder/somephp.php',
type: "POST",
async:false,
dataType: 'json',
timeout: 3000,
data: {
apram:someparam
},
success: function (res) {
console.log(res)
if (res){
console.log(res)
}
},// Success
timeout: 4000, // sets timeout to 3 seconds
error: function (res) {
console.log(res)
alert('Errorconnecting to the server')
}
return something;
});
}
I get a POST error “NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’:….”
the error comes back as .. net::ERR_SSL_PROTOCOL_ERROR
I have just changed some details (ip address etc) but otherwise the code is correct.
Am I getting this error because I am making a request from a secure site to a non-secure (SSL) location ?
Thanks
Paul.