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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:22:10+00:00 2026-06-15T18:22:10+00:00

JavaScript: <script> $(‘#alink’).click(function () { $(#loading).ajaxStart(function(){ $(this).show(); }).ajaxStop(function(){ $(this).hide(); }); $(‘#aresult’).load(‘content2.html’, function() { $(‘#successdata’).html(‘100%

  • 0

JavaScript:

<script>

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

$('#aresult').load('content2.html', function() {
 $('#successdata').html('100% loaded');
});
 });
 </script>

HTML:

<a href="#" id="alink">click me</a>
<div id="aresult"></div>

What is the error of this code ?
I want to load ajax call page when user click on the mouse with loading image

  • 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-15T18:22:11+00:00Added an answer on June 15, 2026 at 6:22 pm

    I’d do it like this, and avoid the global ajax events:

    <script type="text/javascript">
        $(function() {
            $('#alink').on('click', function () {
                 $("#loading").show();
                 $('#aresult').load('content2.html', function() {
                     $('#successdata').html('100% loaded');
                     $("#loading").hide();
                });
            });
        });
    </script>
    

    Also remember the document.ready function etc.

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

Sidebar

Related Questions

I have a JavaScript script: $(#feedbacksubmit).click(function() { if($(#frmfeedback).valid()) { var tname = $(#name).val(); var
I need help getting VIM to correctly indent javascript inside script tags. This is
I have a javascript script like this below which the 'args' contain a string
I have this javascript script, and I would like to print latitude and longitude
In my main Web Page (Viewer.aspx) I have a javascript script tag like this
I have a javascript script. It has a src element to it. This src
First time making a Javascript script from scratch. This works perfectly in Firefox, but
I have a function in my Javascript script that needs to talk with the
This is a bit different. The following code was taken from a javascript script.
My javascript script has an image as URI data, like this: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==

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.