Problem with Code Snippets that use JavaScript

Problem with Code Snippets that use JavaScript

I have trouble every time I attempt to add a code snippet that includes JS. Can someone please tell me what I am doing wrong. 


Lets say I want to include the code used on this codepen: https://codepen.io/ritz078/pen/LGRWjE 


I have tried a few things, but it should work in the following format, right? 


 <!DOCTYPE html>

<html>

<head>

<style>


add css code here


</style>

</head>

<body>


add html code here


<script>


add JS code here


</script>

</body>

</html>



but it doesn’t. I get the following error when I inspect 


SyntaxError: Unexpected keyword 'else'

Failed to load resource: the server responded with a status of 404 ()  on https://sitepreview-XXXXX.zohositescontent.com/portaluser/getCurrentPortalUser

Failed to load resource: the server responded with a status of 404 ()  on https://css.zohostatic.com/sites/XXXXX/v1/zs-site/assets/v1/css/hummingbird-ui.css.map 


where the Xs refer to my site’s identifying code. 


The last time I had an issue with JS it was because the code needed to be a certain way for zoho to allow ChartJS to work. Nothing external needs to be called in the JS here, so I am at a loss. 


Any feedback would be greatly appreciated. 


Steven