1$.ajax({
2 url:'your url',
3 type: 'POST', // http method
4 data: { myData: 'This is my data.' }, // data to submit
5 success: function (data, status, xhr) { // after success your get data
6 $('p').append('status: ' + status + ', data: ' + data);
7 },
8 error: function (jqXhr, textStatus, errorMessage) { // if any error come then
9 $('p').append('Error' + errorMessage);
10 }
11});
1fetch('https://api.covid19api.com/summary')
2 .then(response => response.json())
3 .then(data => console.log(data))
4 .catch(err => {
5 console.log(err)
6 });
1var id = empid;
2
3$.ajax({
4 type: "POST",
5 url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
6 data: "{empid: " + empid + "}",
7 contentType: "application/json; charset=utf-8",
8 dataType: "json",
9 success: function(result){
10 alert(result.d);
11 console.log(result);
12 }
13});
14