Possible Duplicate:
How may I reference the script tag that loaded the currently-executing script?
Can you select the script element that included the JavaScript?
Is there any identifyScript
that could make this work? jQuery is cool too.:
<script type="text/javascript" id="script1">
function identifyScript(){...}
</script>
<script type="text/javascript" id="script1">
identifyScript(); //This function would alert "script1"
</script>
<script type="text/javascript" id="script2">
identifyScript(); //This function would alert "script2"
</script>