javascript - strange debugging issue
<p>My code changes are not being reflected in IE or FF.  </p>

<p>In IE:
I commented out the alert('start'), but I still see the alert when I stop-restart my visual studio debugger.<br>
In FF:
Same code change, but none of the alerts show at all.  I uncommented alert('start') and I still dont see it in FF.</p>

<p>I tried setting my port to stay fixed at 5204.  I also stopped the ASP.NET development server prior to starting the debugger again.  Still doesnt help.</p>

<p>Environment: VS 2010 IE7 and FF3.6.  </p>

<p>Code</p>

<pre><code>simplexhr = {
    doxhr: function (container, url) {
        //alert("START");
        if (!document.getElementById || !document.createTextNode) {
            alert("NO JS SUPPORT");
            return;
        }
        simplexhr.outputContainer = document.getElementById(container);
        if (!simplexhr.outputContainer) {
            alert("NO OUTPUT CONTAINER");
            return;
        }
        var request;
        try {
            //alert("Mozilla AJAX");
            request = new XMLHttpRequest();
            alert(request);
        }
        catch (error) {
            try {
                //alert("IE AJAX");
                request = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (error) {
                return true;
            }
        }
        request.onreadystatechange = function () {
            if (request.readyState == 1)
                simplexhr.outputContainer.innerHTML = 'loading...';
        }
        alert("made it to try AJAX");
        request.open('get', url);
        //alert("ready state: " + request.readyState);
    }
}
</code></pre>

<p><strong>UPDATE</strong><br />
On further testing, this problem is due to caching.  But, it only happens when I use "unobtrusive javascript" or javascript inside its own *.js file linked in the header:</p>

<pre><code>&lt;script src="Scripts/simpleXHR.js" type="text/javascript"&gt;&lt;/script&gt;
</code></pre>

<p>Moving the code into the page - viewing source - the javascript updates everytime with no caching issues.  So is there a better way to perform "unobtrusive javascript"?  Or should it be renamed "unproductive javascript" :P</p>
