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 happeningvar 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');
console.log(loc);
}
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.
I am not an experienced developer with JQuery/Javascript. Currently I am having an issue maintaining same contents through out various processes without querying database again and again. With JQuery/Javascript, I am sure this is easy although I do not know the best way of doing it. Below is an example of what I want: