Currently, I am retrieving data and storing it in global variables in a less than optimal way. Here is the current method:
var tranlationJson =
$.ajax({
type: "GET",
url: "translation.xml",
contentType: "text/xml",
dataType: "xml",
success: function (dataSource) {
tranlationJson=ToJasonParser(dataSource);
}
});
However, I would like to improve this by utilizing promises. The challenge I face is that my code relies on third-party JS files, resulting in something like this:
<script
<script
var translationJson = $.ajax({ ...
<script 111
<script 222
Scripts 111 and 222 contain custom libraries that depend on the translationJson being populated first. How can I ensure that the translationJson is fully loaded before these scripts are executed?