How to get domain name of the server which hosts included JavaScript?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3548857/how-to-get-the-location-src-of-a-javascript-file">How to get the location (src) of a javascript file?</a>  </p>
</blockquote>



<p>I have a JavaScript that will be included on third party sites, using <code>&lt;script src="" &gt;</code>. It will be potentially hosted on couple of different domains/hosts of mine. I need to get a domain name of the server that hosts the script, not the domain name of the server that included the script file. So if i host the script file on ABC.COM and it gets included from ZYX.COM i need to retrieve ABC.COM. I could hard-code the domain name inside the script but i rather keep a single version of my code. </p>

<p>Is there a way to do this from within JavaScript?</p>
