The correct way to use document.currentScript
from src to carve the name of the script that there was only a folder, but this property (currentScript) is missing in IE. More cross-browser approach is to obtain an array of script elements and take the last. Here the drawback is that your script will be the last in the array only if it is connected to html. Any asynchronous loading does not guarantee order.