@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script>
$(function () {
$('#btn').click(function () {
alert("submit handler has fired");
$.ajax({
// type: 'POST',
url: 'www.DevuEgypt.com/api/employees',
data:{},
dataType: 'json',
success: function (data) {
$.each(data, function (index, value) {
var row = $("<tr><td>" + value.FirstName + "</td><td>" + value.Id + "</td><td>" + value.Salary + "</td></tr>");
$("#myData").append(row);
});
},
error: function (jqXHR, textStatus, errorThrown) {
alert('error: ' + textStatus + ': ' + errorThrown);
}
});
//return false;//suppress natural form submission
});
});
</script>
</head>
<body>
<div>
<input type="button" value="GetData" id="btn" />
<table id="myData"></table>
</div>
</body>
</html>