howto js data in ajax code example
Example 1: ajax syntax in javascript
var id = empid;
$.ajax({
type: "POST",
url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
data: "{empid: " + empid + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result){
alert(result.d);
console.log(result);
}
});
Example 2: js ajax receive html
$.ajax({
type: 'POST',
url: "<Your URL>",
contentType: 'application/json; charset=utf-8'
dataType: 'html',
data: { example: 1, id: "0x100"},
success: function (data){
$('#<Your html element id>').html(data);
}
});