I have some sample javascript that I’ve downloaded which I am trying to modify to suit my purposes. The problem is that the heavy lifting, codewise, is being done by an external file, a “.js” file, and in the environment where I am trying to implement this I don’t have the same luxury of referencing an external file as being at “…/somefolder/jsfile.js” (the type of environment I code in is a multi-user environment on which certain types of code are executed from the end user’s perspective; the end user doesn’t have filesystem access to / or …/ or /path/to/current/file or anything else on the server on which this will run).
I have tried replacing the reference to “…/somefolder/jsfile.js” with an http reference after uploading the jsfile to a web-accessible location, but that doesn’t work (either in my environment or in a modified copy of the same html file).
I have tried copying the contents of the jsfile and inserting the text of it into a text container that I can reference in mid-code, but that doesn’t work.
I have tried simply copying the jsfile contents and pasting it directly into the local file / local code, replacing src="…/somefolder/jsfile.js" with the actual code that’s in the jsfile — and I really expected that to work — but it doesn’t.
(In other words, where it WAS this:
<script type=“text/javascript” src="…/somefolder/jsfile.js"></script>
I replaced with this:
<script type=“text/javascript” ENTIRE CONTENTS OF JSFILE PASTED HERE </script>
)
Got any tips?