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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:17:11+00:00 2026-05-30T13:17:11+00:00

I have this script: $(function() { $(this).ajaxStart(function() { $(#loading).show(); }); $(this).ajaxStop(function() { $(#loading).hide(); });

  • 0

I have this script:

$(function() {
$(this).ajaxStart(function() {
$("#loading").show(); });
$(this).ajaxStop(function() {
$("#loading").hide(); });
});

$(document).ready(function() { 
$('.button').click(function () {
$("#contentDiv").load("content.php");
});

$('.button2').click(function () {
$("#contentDiv").load("content2.php");
});
});

And this html:

<div id="contentDiv">
<div id="loading"></div>

</div>

I want to show loading .gif before every new load, but now it works only first time whole page is loaded. So when I click first time “button”, “loading” shows, “content” is loaded and “loading” hides. When I than click “button2”, “content2” is loaded but “loading” did not shows. I try to take out “loading” div from “contentDiv”, but than “loading” never hides.

  • 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-30T13:17:12+00:00Added an answer on May 30, 2026 at 1:17 pm

    I made it working this way:

    $(document).ajaxStart(function() {
    $('.loading').show();
    $('#contentDiv').hide();
    }).ajaxStop(function() {
    $('.loading').hide();
    $('#contentDiv').show();
    });
    

    html:

    <div id="contentDiv"></div>
    <div class="loading"></div>
    

    I have to made loading div class because ID was not working.

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

Sidebar

Related Questions

I have this script in index.php file: <script type=text/javascript> $(document).ready(function(){ $('#ads').load('output.php').fadeIn('slow'); }); </script> And
I have this jquery code which pushes the content down on click: <script> $(document).ready(function()
I have this script: <script type=text/javascript> $(document).ready(function(){ $('#openframe').click(function() { $('#holder').fadeOut(500); $('#framer').fadeIn(500); }); }); </script>
I have this script: $(document).ready(function() { $('#Checkout1').addClass('disabled'); $('#voorwaarden').change(function() { $('#Checkout1').attr('disabled', $(this).is(':checked') ? null :
I have this script using jquery: $(document).ready(function() { $('.fotky,.video,.diskusia,.onas,.zbrane,.akcie,.tabroz,.tabburk,.tabhil,.tablest').append('<span class=hover></span>').each(function () { var $span
I have the following JS code <script type=text/javascript> $(document).ready(function () { $(#innerDiv1).ajaxStart(function () {
I have this JQuery script: $('#searchinput').keypress(function() { $('#realadstable tr').show().not(':contains(' + this.value + ')').hide(); });
I have this script that opens a new page inside a span: $(document).ready( function()
I have this at the top of my jQuery script: $().ajaxStart(function() { alert('ok'); });
I have this script, running on a links list: $('li#linkcat-25 a').bind('click', function (e) {

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.