The error message I get in my browser's console is :
"XMLHttpRequest cannot load http://104.131.67.45/medical/register. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."
please help me. Below is the code I am using to post to a remote server
$(document).ready(function(){
$("#save").on("click", function(){
$.ajax({
url:"http://104.131.67.45/medical/register",
type:"POST",
dataType:"json",
jsonp:"callback",
async:true,
data:{mydata},
ContentType:"application/json",
success: function(response){
alert('success');
//alert(JSON.stringify(response));
},
error: function(err){
alert('failed');
//alert(JSON.stringify(err));
}
//var obj = jQuery.parseJSON( response );
// Now the two will work
//$.each(obj, function(key, value) {
//alert(key + ' ' + value);
});
});
});