I've been working on implementing a loading overlay on my website based on the presence of angularjs without any errors.
Currently, I have this concise script that checks for the presence of angularjs:
<script type='text/javascript'>
window.onload = function () {
if(typeof angular == 'undefined') {
document.getElementById("page-loader-overlay").style.display = "block";
} else {
document.getElementById("page-loader-overlay").style.display = "none";
}
};
</script>
However, I'm also interested in ensuring that there are no syntax errors causing issues with certain browsers that may render the above check ineffective. Is there a way to incorporate a syntax check into this validation?
Thank you in advance.