Why is appended script running twice in IE8 and IE9?
<p>I'm doing the client-side work for an ASP.NET app, and the function below works across browsers:</p>

<pre><code>$('#identifier').click(function () {
    $('#script-placeholder').append('&lt;script type="text/javascript" 
    src="SERVICEURL?callback=test"&gt;&lt;/script&gt;');
});
</code></pre>

<p>When I click on the element with an ID of 'identifier', the service sends back a response wrapped in a JS function call (i.e. </p>

<pre><code>test('response');
</code></pre>

<p>However, in IE8 and IE9, if I execute the script once, navigate to a different page, then back and click 'identifier' again, the callback function is getting called twice. Anyone have any ideas why or know of a workaround? Any help would be greatly appreciated! (Note that I'm encountering this problem on on localhost)...</p>
