I\'ve got following page:
You can try this, though it's somewhat of a hack:
(function() {
var scr = document.getElementsByTagName('script'),
parent = scr[scr.length - 1].parentNode;
// parent is the parent node of the last script on the page
})();
If you've got code in tags like that, then when it runs the last script on the page will be the one that contained it.