json data ajax code example
Example 1: jquery ajax json
$.ajax({
method: "POST",
url: "some.php",
dataType: "json",
data: {}
}).done(json => console.log(json));
Example 2: How to pass json format data on ajax call
BY LOVE
1- Pass the JSON format data in this way
data: { "str1": "Love", "str2": "Singh" }
2- You can use JSON.Stringfy function also
var employee = { Id: 101, Name: "Love singh" };
data: JSON.stringify(employee)