diff --git a/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js b/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js index f877b70d..50e5525d 100644 --- a/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js +++ b/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js @@ -249,18 +249,17 @@ function calculateImageScale() { } } - function loadAnnotationTypeList() { - $.ajax(API_ANNOTATIONS_BASE_URL + 'annotation/loadannotationtypes/', { - type: 'GET', - headers: gHeaders, - dataType: 'json', - success: function (data) { - displayAnnotationTypeOptions(data.annotation_types); - }, - error: function () { - displayFeedback($('#feedback_connection_error')) - } - }) + async function loadAnnotationTypeList() { + try { + let response = await fetch(API_ANNOTATIONS_BASE_URL + 'annotation/loadannotationtypes/', { + method: 'GET', + headers: gHeaders, + }); + let data = await response.json(); + displayAnnotationTypeOptions(data.annotation_types); + } catch { + displayFeedback($('#feedback_connection_error')) + } } function displayAnnotationTypeOptions(annotationTypeList) {