title: How can I find the <script> element where my JavaScript is declared?
body: <p>For a fragment of HTML/JavaScript that gets loaded into a host web page dynamically, I need the JavaScript fragment to know about where it is declared. Is there a way of finding the  tag that the currently executing JavaScript was loaded from?</p>
  
  <p>The HTML fragment is loaded from the same host as the current page using a jQuery ajax call and inserting the result into the DOM.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>What I really am trying to do, and the above would be one potential way of implementing it, is to have a fragment of HTML/JavaScript being loaded dynamically and a known initialization function be called by the host page with some parameters. Any portable solution that would allow for the worlds to meet would solve my problem.</p>