AspNetCore.Docs/aspnetcore/includes/add-javascript-jquery/samples/sample5.js

10 lines
283 B
JavaScript

function find() {
var id = $('#todoId').val();
$.getJSON(apiUrl + '/' + id)
.done(function (data) {
$('#todo').text(formatItem(data));
})
.fail(function (jqXHR, textStatus, err) {
$('#todo').text('Error: ' + err);
});
}