In html, if I load an external javascript file like this
<script src="public/js/mycode.js"></script>
then in mycode.js
file, is there some javascript function code I can call and it will return the string "mycode.js"
or even "public/js/mycode.js"
.
I don't want to hardcode any information about the script tag such as the filename.
Does anyone know a way?
Thanks