title: Find own origin in JavaScript
body: <p>Is there a way to find the origin of the current running script?
  I would like to add a different behavior depending where the script was loaded from.</p>
  
  <p>e.g. was loaded from:</p>
  
  <pre><code>http://localhost:8080/js/myscript.js 
  </code></pre>
  
  <p>vs </p>
  
  <pre><code>http://www.myhost.com/js/myscript.js
  </code></pre>
  
  <p>I'm not the one who loads is so I can't add some info in load time, and the script is loaded dynamically using <code>$.getScript()</code>, so I can't look for the  element.</p>