Custom JavaScript can be added to any page in Strategy Web. Default behavior is that any additional JavaScript is executed as soon as it is read. This snippet demonstrates a method for only executing custom logic once the page DOM has finished loading, ensuring all other resources that the JavaScript might rely on have also loaded.
function myCustomJSFunction() {
document.onreadystatechange = function() {
if (document.readyState == "complete") {
// logic after page finishes loading
}
};
};
myCustomJSFunction();