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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:10:04+00:00 2026-06-16T10:10:04+00:00

I have an issue. I have a login page, which is the first page

  • 0

I have an issue. I have a login page, which is the first page in my mobile application and contains two fields: username and password, and a submit button. Upon submit, I do an ajax call to check the validity, if successful, it switches pages to the home page.

The problem: if successful, it shows the login page, with both fields blank for 1-2 seconds then finally switches to the home page. Extremely slow or laggy.

$(document).bind('pageshow', function () {          
            $('#loginSubmit').on("click", function(){
                    $('#loginSubmit').button('disable'); 
                    var formData = $("#loginForm").serialize();
                    console.log(formData);
                    $.ajax({
                        type: "POST",
                        url: "php/checkLogin.php",
                        cache: false,
                        data: formData,
                        success: function(data){
                            var check = $.parseJSON(data);
                            console.log(check);
                            if (check.approved == 1)
                            {
                                $.mobile.changePage('#home');
                                username = $("#username").val();
                            }
                            else
                            {
                                // wrong username or password
                            }
                        }
                    });
            }); 
        });

I’ve added a global loading spinner (not shown here), but that only shows up for half a second and disappears. I’m not sure how to handle this.

Console log:

POST http://localhost/jquery/php/checkLogin.php 200 OK 1.02s
POST http://localhost/jquery/ 200 OK 48ms

The first call seems to be the valid check, the second one I’m assuming is loading the home page.

  • 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-06-16T10:10:05+00:00Added an answer on June 16, 2026 at 10:10 am

    $.ajax is not your problem, jQuery Mobile has a few performance issues (mainly with Phonegap in combination with android platform).

    In your case you can do few things.

    From what I can see you are doing submit as a part of click event. Click events have a 300 ms delay. This can usually (usually because a lot of people dont understand when to use the fastclick implementation) be fixed with the fastclick : https://github.com/drowne/jquery.mobile.fastclick.

    Worst case scenario, if you are creating a mobile app bind touchstart event instead of click event. Read this article to understand why: Touchstart vs Click. What happens under the hood?

    Finally ajax spinner disappeared because ajax call entered a successful state but page is still loading. To counter that still show it at this ajax call point:

    beforeSend: function() {
        $.mobile.showPageLoadingMsg(true);
    }
    

    But hide him in this page event:

    $('#home').live('pageshow', function (event) {
        $.mobile.hidePageLoadingMsg();
    });
    

    This will hide a spinner when page was successfully loaded.

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

Sidebar

Related Questions

The login page in my Tapestry application has a property in which the password
Heres my issue. I have a login screen which is shown using PresentModalViewAnimated. Once
Using 960.gs, I have a page which is a login screen which uses a
I have an application which uses WPF + Page Navigation. The application and the
I am migrating JSF1.2 application to JSF 2.1. It has a Login page, which
I have a standard HTML login page, which I would much rather use than
We are new to ROR, We have issue in creating Login/Logout process in ROR
I have an issue. We have a website, where person can login and make
Symfony2 and FOS User Bundle issue... I have implemented my own login form in
I have an ASP.NET Page that contains a User control called ReportCtrl (my own

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.