Connected frontend and backend

This commit is contained in:
2023-06-06 13:52:39 +02:00
parent b65962247a
commit 79b9a54334
2 changed files with 19 additions and 1 deletions

View File

@@ -135,6 +135,24 @@ function fillDefaultXSLT() {
} )
}
/**
* The `fillDefaultXQuery()` function fetches a default XQuery from the server and sets the value of the element with id "transformArea" to the fetched template.
*
* @function
* @name fillDefaultXQuery
* @kind function
* @returns {void}
*/
function fillDefaultXQuery() {
const serverAddress = window.location.protocol + "//" + window.location.hostname;
fetch(serverAddress + "/assets/samples/sampleXQuery.xquery")
.then( response => response.text() )
.then( (XQueryTemplate) => {
document.getElementById('transformArea').innerText = XQueryTemplate;
highlightSyntax("transformArea");
} )
}
/**
* It sets default content for the element an changes it's color to grey
*