how to use jsonp request to store data in database?
I manage server/client sides and.... I've tried add callback function as a string before server response and as a parameter in jsonp request but without success. Take a look at my source (ionic solution): http://codepen.io/studentttt/pen/BNPPoP
var d = [{"user_type_id":0, "user_venue_id":0, "fname":r}];
var req = {
type : 'POST', //'GET'
crossdomain: true,
//callback: 'angular.callbacks._0',
data: d,
contentType: "application/json",
dataType: "jsonp",
url : 'http://www.***.pl/index.php/json/adduser',
};
$http(req).success(function(res){....
When I use GET (method instead of POST) there is the same error:
"NetworkError: 500 Internal Server Error - http://www.***.pl/index.php/json/adduser"
adduser error app.js (line 58) detailed error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.***.pl/index.php/json/adduser. (Reason: CORS header 'Access-Control-Allow-Origin' missing).