+ $("#layers-data-loading").remove();
+
+ const spanLoading = $("<span>")
+ .attr("id", "layers-data-loading")
+ .attr("class", "spinner-border spinner-border-sm ms-1")
+ .attr("role", "status")
+ .html("<span class='visually-hidden'>" + I18n.t("browse.start_rjs.loading") + "</span>")
+ .appendTo($("#label-layers-data"));
+
+ dataLoader = new AbortController();
+ fetch(url, { signal: dataLoader.signal })
+ .then(response => {
+ if (response.ok) return response.json();
+ const status = response.statusText || response.status;
+ if (response.status !== 400) throw new Error(status);
+ return response.text().then(text => {
+ throw new Error(text || status);
+ });
+ })
+ .then(function (data) {