I am trying to replicate the functionality from this link https://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html so I copy the javascript file from this link https://neil.fraser.name/software/diff_match_patch/svn/trunk/javascript/diff_match_patch.js and then go to shared components > static files and upload the .js file. then I add a line like this in the header of the document.

But when I run the page the js functions are not found

I used another simple .js file with an alert function using the same method and it worked. So question is why can't apex see the .js functions? Am I doing something incorrect? I want to get the difference function working.
Any help would be appreciated, thanks.