Why does an AJAX call sometimes redirect the page?
<p>I have a page that contains 3 iframes, the top header, left navigation and the content iframe.</p>

<p>(this is a legacy application).</p>

<p>The page that contains the 3 iframes makes an jQuery AJAX call to a page:  </p>

<p><code>/users/getNotifications.aspx</code></p>

<p>Sometimes (I believe when I am not logged in) the browser redirects to the URL of my AJAX call i.e. localhost/users/getNotifications.aspx</p>

<p>I obviously don't want it to redirect like this, any idea why this may be happening?</p>

<p>Note:</p>

<p>My page responds with:</p>

<pre><code> Response.ContentType = "text/html";
 Response.Write(resultInHtml);
</code></pre>

<p>Also, the page doesn't redirect if the user isn't logged in.</p>

<p>This is the method I call to get the data using an ajax requesT:</p>

<pre><code>var x = function () {
        $.ajax({
            type: "GET",
            url: webRoot + "users/getNotifications.aspx",
            cache: false,
            success: function (payload) {
                if (payload.length &gt; 0) {
                    $("#users-popup").html(payload);
                }
                displayPopup();                
            }
        });
    }
</code></pre>
