Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 663765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:31:31+00:00 2026-05-13T23:31:31+00:00

I am requesting something with $.ajax and i am getting a 302 or 200

  • 0

I am requesting something with $.ajax and i am getting a 302 or 200 status after the call.
I want to insert something into the DOM when status is 200 and make the actual redirect when the status returned is 302.

For that I am using: (took that snippet from a diffrent thread here)

complete: function (XMLHttpRequest, textStatus) {
    alert(XMLHttpRequest.status);

    if(XMLHttpRequest.status === 302) {
        //if it wants to redirect
        window.location = XMLHttpRequest.getResponseHeader("Location");
    }
}

When POST status returns 200 everything works perfect.

The problem is, that when I am getting the 302 status (which I can see I get with firebug), firebug shows me, that there is a GET request called immedidiately after the first Post and I am getting alerted “200” even though the initial POST has a 302 status. Is it normal, that there is a GET shorty after a POST with staus 302 returned, and if yes why am I obviously getting the status of that GET and not the POST?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:31:32+00:00Added an answer on May 13, 2026 at 11:31 pm

    It’s normal. There’s no way to detect 302 status. Browser first redirect and then you get some status but it is not status of page you requested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Total beginner in HTML requesting help .. hoping for a 200 response. Something like
Something I find really confusing, is why are AJAX requests limited to the same
here's the problem: when requesting url like - http://server/path/to/file.html?param=../../something/something i get response: 500 Internal
We keep getting this exception: Application_Error: Unhandled exception has been occured while requesting:/~/media/Flash Movies/nameoftheItem.ashx
I am requesting with AJAX (using jQuery) a tag which contains a Javascript function
When requesting (ht|x)ml with ajax you can only send requests to the same domain.
I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) {
I'm running into a situation where requesting a list of permissions that a user
I am brand new to Jquery and have run into something that if answered
When requesting hardware for a WebLogic server, what hardware would best improve its performance?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.