Do you need to get the URL or folder location of the currently executing script?
Here’s how i did it!
var b = (b = document.getElementsByTagName("script")) && b[b.length - 1], c = (c = b.src) && c.substring(0, c.lastIndexOf('/')) + '/'; alert(c);
Why would you need to do this?
Well if you have a script you distribute which is setup to dynamically load all it’s CSS and other components the location to each of these will need to be set each time someone installs it or defined in the script itself but this way it does it on it’s own!