I want to get JSON data using POST method in Ajax. I used below code to retrieve the data but it gives an error like
TypeError: Illegal invocation
http://mylocalhost.com/statics?action=retrive&table=log
On above link I got data in JSON format. Here mylocalhost.com is replaced by my IP and port number.
var domain_url = "http://mylocalhost.com/statics";
var obj = {
action: 'retrive',
table: 'log',
dataType: 'json',
processData: false,
limit: 20,
option: {_id: {$lt :id}}
};
console.log(obj)
$.ajax({
url: domain_url,
type: 'POST',
data: obj,
success: function(data, res){
console.log(data)
},
error: function (errorThrown, res)
{
}
});