Linked Questions
194 questions linked to/from How to manage a redirect request after a jQuery Ajax call
9 votes
4 answers
12k views
jQuery Ajax and redirect response from server
I have a situation where I send jquery ajax post request but in my web application, the handler for this specific ajax request (after processing post parameters), will invoke an action in another ...
17 votes
5 answers
26k views
What happens when an AJAX request gets a "302 Moved" response?
I'm trying to AJAXify an old website form without modifying the back end. Originally, the backend would response with a "302 Moved" redirect to a "thank you" page after receiving the form. Now, when ...
13 votes
4 answers
3k views
How to gracefully handle login expiration for an Ajax call?
My web application is made up of a lot of Ajax calls to server side RESTful APIs. Each time a customer login my site, the login page will get a JWT (JSON Web Token) token from server and store it as a ...
9 votes
4 answers
28k views
301 redirect on AJAX -- redirected?
I have an AJAX call to a server endpoint that does a 301 redirect to the same page, but with a trailing slash. Does the browser follow redirects when called with AJAX or does it ignore them? In my ...
5 votes
1 answer
19k views
Redirect after POST using the Location header with jQuery
I want to redirect to the target using the Location header with jQuery 1.7. My code looks like this $('#creationLink').click(function(){ $.ajax({ type: 'POST', url: '/', success: ...
6 votes
3 answers
29k views
Redirect after POST request with jquery
I'm working with Django. I have an HTML page, where I do some Javascript stuff, and then I do a jQuery post, in this way: $.ajax({ url: '/xenopatients/measurement/qual', type: 'POST', data: ...
10 votes
3 answers
24k views
ASP.Net MVC Redirect out of a partial view from controller to a full view from a different controller
Ok. So I have an issue where I need to do some authorization checks inside the controller action. There are authorization roles, but it can exist that someone has TypeOnePayment, but not TypeTwo [...
3 votes
2 answers
21k views
How do I determine the status code of a Fetch request?
I want to fetch an URL and determine what status code it has, especially if it has an HTTP 301 or HTTP 302 status code: fetch('https://httpstat.us/301', { redirect: 'true'}) .then(response =&...
4 votes
2 answers
7k views
use spring security to tell ajax requests where the login page is
I have some url secured with spring (configured through xml). It works. However when I try to hit that endpoint with an ajax request I get a 302 (found) response. This redirects my ajax call to the ...
7 votes
1 answer
19k views
Session Start and Action Filter for Session Timeout handling
I have a MVC4 application with Windows Authentication. User can type url of any of the 10 views to load the application. There is no specific home page I need to redirect to a session timeout view ...
9 votes
1 answer
6k views
How to detect a server redirect with $.get()
No Duplicate Question This question is not a duplicate of one of the above mentioned, since I have no control over the server response as it is the case in the other two questions above. I use $.get ...
14 votes
3 answers
9k views
When a response to $.ajax is 301, can I programmatically get the new URL?
Is there a way to get the URL you are ultimately redirected to when the response to an xhr request is 301? I have a site that contains numerous legacy URLs from an older version, which return 301 ...
2 votes
2 answers
11k views
Flask: redirect(url_for()) returning html but not loading page [duplicate]
I am building a small web app in Flask, a code excerpt is below. Basically, I am trying to store some data in startsession and then move on to tagpage once this is achieved. But redirect is not ...
3 votes
2 answers
17k views
Redirect to another page after Ajax call?
so this is a hard one for me to try and explain. I have a razor page that when a button is clicked it calls a javascript function which makes an ajax call to a handler in the back end. The handler ...
5 votes
1 answer
4k views
Django view security and best-practices
I've recently begun working on Django and now my app is nearing completion and i've begun to wonder about security and best-practices. I have view that generates a page and different functions in the ...