title: reference the script tag that loaded the currently-executing script in an ajax form
body: <p>Following code run fine in a non-ajax environment.</p>
  
  <pre><code>&lt;div id="target"&gt;
    &lt;script&gt;
        var thisScript1 = $('script').filter(':last');
        $(document).ready(function () {
            console.log(thisScript1.closest('div').attr('id')); // prints 'target'
        });
    &lt;/script&gt;
  &lt;/div&gt;
  &lt;div id="second"&gt;
    &lt;script&gt;
        var thisScript2 = $('script').filter(':last');
        $(document).ready(function () {
            console.log(thisScript2.closest('div').attr('id')); // prints 'second'
        });
    &lt;/script&gt;
  &lt;/div&gt;​
  </code></pre>
  
  <p>If I then reload the div 'target' with the same content using Ajax, <code>$('script').filter(':last')</code> references the last script of the page and not the current one anymore. </p>
  
  <pre><code>&lt;div id="target"&gt; // reloaded using Ajax
    &lt;script&gt;
        var thisScript1 = $('script').filter(':last');
        $(document).ready(function () {
            console.log(thisScript1.closest('div').attr('id')); // prints 'second'
        });
    &lt;/script&gt;
  &lt;/div&gt;
  &lt;div id="second"&gt;
    &lt;script&gt;
        var thisScript2 = $('script').filter(':last');
        $(document).ready(function () {
            console.log(thisScript2.closest('div').attr('id')); // prints 'second'
        });
    &lt;/script&gt;
  &lt;/div&gt;​
  </code></pre>
  
  <p>It's like <em>the current script is inserted where the old one was</em> (I'm guessing) though is correctly executed on load time.</p>
  
  <p>How could I have the requested behavior on an Ajax environment ?</p>