I\'ve got following page:
I remember this from a previous question. The number of scripts on the page is incremented by 1 with each script that is processed, and they are processed in order. So this function will get the current script number:
function countScripts() {
return document.scripts.length;
}
Then you can go get the parentNode of that script:
var thisScriptParent = document.scripts[countScripts()].parentNode;