URL of current script in JavaScript
<p>How can I find out the URL of the JS file that was called?</p>

<p>Let's say the JS file (which is part of a library) and the HTML file (which is the application) are on a different server. To find out the URL of the HTML file is easy. But how can I find out the server name and path of the JS files' server within the JS file itself? (Edit: There is a loader which invokes other JS files of thsi library in the same directory structure)</p>

<p>Preferably a JQuery or pure JS solution.</p>

<p><strong>Edit:</strong></p>

<p>After I learned from your answers and comments I decided it would be cleaner to actually move the loader code to the first server, where also the html lives, which avoids the problem. </p>
