Xhr Not Returning Header

The script below works great as it returns data except the location, which is sent from the server. It return null. Even when I try calling getAllResponseHeaders() function, Location is not listed. Can you give an idea on how to go about this?

         $.post(uri, credential, function (data, textStatus, xhr) {
             //Let's check status code
             // add spinner to indicate something is happening

            var target = document.getElementById('login')
            var spinner = new Spinner(opts).spin(target);

            if(xhr.readyState == 4) {
                if (xhr.status === 202) {

                    //Credentials accepted, take me to user page
                    //window.open('user', '_self');
                    var loc = xhr.getResponseHeader('Location');

Server side code

msg.Headers.Location = new Uri(Request.RequestUri +"/"+user.us_user_id.ToString()+"/"+ user.ucat_cat_id);

Moreover, chrome debug returns the location but not on the script.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.