Browser is showing Javascript code instead of processing it [closed]

I see a couple of issues in the code you have posted.

The script tag should be written properly:

<script type="text/javascript">
    //Code
</script>

It is document.write, with a small case d. If your code is in a separate JavaScript file, then you can include it and mention the source in the script tag. If you’re directly writing it in the head tag, please try with the proper syntax as I have mentioned above.