update for the javascript

This commit is contained in:
2024-06-23 12:20:50 +03:00
parent 6844fe42bc
commit fae0a35af9
4 changed files with 49 additions and 28 deletions

View File

@@ -124,18 +124,11 @@ function showContainer(className){
function runme(data){
alert(data)
}
async function fetchContent(uri) {
try {
const response = await fetch(uri);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const content = await response.text();
return content;
} catch (error) {
console.error(`There was a problem with the fetch operation: ${error.message}`);
}
}
function fetchContent(uri) {
return fetch(uri)
.then(response => response.json())
.catch(error => console.error('Error:', error));
}
function updateForm(uri, eid){
fetchContent(uri).then(content => {
switch(eid){