If I have a site, example.com, and a page on that site references a Javascript at subdomain.example.com/serveAd.js -- is there a way from within serveAd.js to know its own URL, or the domain from which it was downloaded?
(The JS can certainly know all about the page that called it. I want to know if the JS knows about its own origin.)