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

  • Home
  • SEARCH
  • 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 8709297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:20:01+00:00 2026-06-13T04:20:01+00:00

I am experiencing the strangest behaviour on our website, and it is making things

  • 0

I am experiencing the strangest behaviour on our website, and it is making things incredibly slow.

My team and I have a website running entirely on AJAX. So for the login, I have some js ajax that loads the login box into our index page. The html containing the login box has a script link in the head. This script listens for the login form submission, and sends the form data to the server for authentication through ajax.

The html that contains the login box only gets loaded once, but the js file that it links to gets loaded multiple times. The amount of times change. From 5 times to 15 times and I cannot see a pattern or anything. This happens everywhere on our site, not just at login time.

This issue really has me stumped and I’m totally stuck. Is it because I have ajax in a js file that is loaded in initially with ajax?

I would really appreciate your insight and help!

EDIT:

As requested, some code:

This is a stripped down version of loadContent() in the Interface.js file. This specific function loads all site content into the content area on index.php. When the page is refreshed, the first thing sent to the function is the location of the login.php file, containing the login box:

loadContent: function(page) {

var self = this;


//just some animations to make things look good
$(self.error).fadeOut(150, function() {
    $(self.content).fadeOut(150, function() {
        $(self.loading).fadeIn(150, function() {
            $.ajax({
                url: page,
                success: function(data) {                            
                    //response data
                    var $response = $(data);                         

                    $(self.content_1).html($response);                    

                    //definitions for contentbox-2
                    self.contentHeading_2.html("Replies:");                           
                    self.content_2.html(postReplies);

                    //redisplay the  content after it has loaded in.
                    $(self.loading).fadeOut(150, function() {
                        $(self.content).fadeIn(150, function() {
                            // Content faded in
                        });
                    });
                },
                error: function() {
                    $(self.loading).fadeOut(150, function() {
                        $(self.error).fadeIn(150, function() {
                            // Error faded in
                        });
                    });
                }
            });
        });
    });
});

this.page = page;
}

And then the login.php file:

<!DOCTYPE HTML>
<html>
    <head>
        <title></title>
        <script type="text/javascript" src="js/login.js"></script>        
    </head>
    <body>
        <div class="padded loginphp">
            <div id="loginbox">
                <!-- the login box comes here
            </div> <!-- #loginbox -->

        </div>
    </body>
</html>

And the login.js file:

$(document).ready(function() {  
    $('#honeyloginform').submit(function(event) {
        //event.preventDefault();
        login();
        return false;
    });
});

function login() {
    $('.errorinputfields').removeClass('errorinputfields');
    if (isEmpty($('#username'))) {
        $('#username').addClass('errorinputfields');
        $('#username').focus();
        return;
    }
    if (isEmpty($('#password'))) {
        $('#password').addClass('errorinputfields');
        $('#password').focus();
        return;
    }
    $('#honeyloginform').fadeOut(100, function(){
        $('#loginbox .loading').fadeIn(300, function(){                                         
            var pword = $('#password').val();
            var remember = "no";
            if ($('#remember').is(':checked')) {
                remember = "yes";
            }
            var JSONobj = {
                username: $('#username').val(),
                password: pword,
                rem: remember
            };
            $.ajax({
                url: 'ajax/login.php',
                data: JSONobj,
                success: function(data) {
                    //alert(data);
                    var JSONobj = JSON.parse(data);
                    if (JSONobj.Success) {
                        Interface.login(); //just loads the landing page after login
                        //window.setTimeout('location.reload()', 300);
                    } else {
                        $('#loginbox .loading').fadeOut(300,function(){
                            $('#honeyloginform').fadeIn(300);
                        });
                        $('#username').focus();
                        $('#loading-message').text(JSONobj.Message).show();                         
                    }
                }
            });                         
        });    
    });
}
  • 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-13T04:20:03+00:00Added an answer on June 13, 2026 at 4:20 am

    I’ve managed to find the problem, and fix it!

    I’ve made a change to my interface layout, and as a result, the three selectors, $(self.error), $(self.content) and $(self.loading) each contain more than one element, where it always only contained one each.

    This seems to cause the callback functions to be compounded or something, as everything inside the final callback in loadContent() was called 9 times.

    So it was a simple case of redefining the selectors, so that they refer to one element each.

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

Sidebar

Related Questions

I am experiencing some strange behaviour with MySQL. I have a table, not large,
I am experiencing some strange behaviour and I really don't have test date/ environments,
I am experiencing strange log cat behaviour in my app, either I have two
We're experiencing a strange problem in IE8 with our website. Sometimes our homepage stays
I'm experiencing som strange behaviour by the Silverlight ComboBox. I started out with some
I am experiencing a strange behaviour of my application in Chrome browser (No problem
While testing some JavaScrpt code in IE8 I'm experiencing some strange behaviour when doing
I'm experiencing some strange behaviour when using a stylus with swing. I am interpreting
I am experiencing some strange behaviour in my Java server application whereby database operations
I am experiencing some strange behavior with SQL Server CE 3.5 SP2. I have

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.