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 U
I'm pretty sure, as the script is parsed that the last node available in the DOM will be the one being parsed.
Try this in an external JS to see:
var scripts = document.getElementsByTagName('script'); var lastScript = scripts[scripts.length - 1]; alert(lastScript.src);