If I load a JavaScript source file like so:
<!DOCTYPE html>
<html>
<head>
<script src="src/file.js"></source>
</head>
<body>
</body>
</html>
My question is that how could file.js know that the relative path to its location is src/? I need this information for building up a URL from the source file that depends on the URL it was loaded from.