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 3721012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:24:38+00:00 2026-05-19T05:24:38+00:00

Today i discovered that my dev version of my website do not execute success

  • 0

Today i discovered that my dev version of my website do not execute success callback, but all other javascript and jquery code is running good. Even my ajax request is performed and i can see response in firebug.

$('#login').submit(function(){
    var email = $('#l_email').val();
    var pass = $('#l_pass').val();
    if(email && pass != ''){
        var str = decodeURIComponent($(this).serialize());
        $.ajax({
            type: "POST",
            url: "login.php",
            data: str,
            success: function(msg){
                if(msg == 'OK'){
                    window.location = 'index.php'
                }else if (msg == 'NOT_OK'){
                    if(lang == 'lv'){
                        alert(message);
                    }else if(lang == 'ru'){
                        alert(message);
                    }
                }else if (msg == 'EMAIL_NOT_VALID'){
                    if(lang == 'lv'){
                        alert(message);
                    }else if(lang == 'ru'){
                        alert(message);
                    }      
                }
            }
         });
    }else{
        alert('That form is empty.');
    }
    return false;
});

The thing is $.ajax part executes fine and i can see response in firebug “OK”. But redirect is not happening and even if i replace that redirect with something like alert or console.log nothing comes up.

What could cause this? It’s really hard to track since firebug gives no errors.

Resolved: by suggestion of Reigel, wrapping success callback data return in $.trim();

  • 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-19T05:24:39+00:00Added an answer on May 19, 2026 at 5:24 am

    How about adding an else { alert('No match for msg'); } block to the code of your success function, maybe you’ll see that msg does not match any of your IFs statements.

    jQuery doc says the signature of the success function should be: success(data, textStatus, XMLHttpRequest) so I guess msg if not getting the response status but rather the data.

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

Sidebar

Related Questions

I am not particularly new to C/C++ but today I discovered some things that
Today I discovered that my fresh installation of Apache HTTP Server is able to
Today I discovered something that makes me sad: objects of type System.Generic.Collections.List don't have
I discovered(*) today that, depending on the server, my TSQL commands were case-sensitive, meaning
I discovered today that I can switch back to a branch even after I
I was reviewing the logs for my companies servers today and I discovered that
Today, I discovered that using Collections.synchronizedXXX doesn't play well with reflection. Here's a simple
So we went to implement something today, and discovered that there already is several
Today I discovered that Entity Framework was adding an unnecessary sub query to the
Well I've just discovered JSON today but I have a problem using it correctly.

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.