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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:30:16+00:00 2026-05-22T23:30:16+00:00

Ok not exactly ajax. But we launch a modal window, which fires up straigh

  • 0

Ok not exactly ajax.

But we launch a modal window, which fires up straigh away.
The content of the modal fetches data from our dB and takes about 3 seconds to load, on a good connection.

What I would like to do is wrap the entire content in a loader div.

I think thats the correct terminology …

So:

< div id=”main content” >
blah … blah … blah …
< /div >

Becomes…
< div class=”content-loader” >

 < div id="main content" >
  blah ... blah ... blah ...
 < /div >

< /div >

I believe we have to fire an open event and a close event on success… ( I am no Js expert as you can tell )

Was reading: http://malsup.com/jquery/block/

What I dont get is, our code isnt fetching via ajax. It is via query

So how should we set this up…
Not intrincily bothered if we dont have a loader.gif.

Perhaps a overlay the full size of the modal with a 50% 50% positioned Loading message..

I gather the way this works is the page somehow monitors activity, and when activity is complete the loader message disappears.

Ok so thats fine, but … one issue I have with that is we perhaps will be yanking in images from perhaps a third party site, and so surely the loader will wait for that ping to succeed too.. or can we vary what the loader in fact is happy with … ie just html, etc etc

Any examples would be great cheers

  • 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-22T23:30:17+00:00Added an answer on May 22, 2026 at 11:30 pm

    If you don’t mind using a plugin for this, you might have a look at jquery-loading, which makes this whole process as easy as:

    $.loading({
        onAjax: true,
        align: 'center',
        img: 'jquery-loading/loading.gif',
        mask: true
    });
    

    This assumes that you’re using the standard jQuery AJAX functions ($.ajax(), $.get(), etc), which you claim you aren’t. I’m a little confused by how you’re loading the query in the modal window if not by AJAX (an iframe, maybe?), but if you need to, you can drop the onAjax:true parameter and manually call $.loading() to start the overlay + spinner and then call $.loading(false) when your content is fully loaded. In this case you’ll need some way to execute a callback function when the content is loaded, either by listening for a 'load' event or by having the returned HTML call the function for you.

    Edit: The easiest way to close the loading animation if you’re using an iframe is to attach the callback to the iframe’s load event with jQuery:

    $('#my_iframe').load(function() { 
        $.loading(false);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not exactly about programming, but I need help with this. I'm running a development
Not exactly sure how to look this up, but I'm not finding the solution
This is not exactly a programming question, but it's highly related. We are writing
I have a few tables that have similar fields but not exactly the same.
sorry, it's not exactly a programming question, but I am currently in a research
Similar to this thread, but not exactly: How To Cache Information In A Threadsafe
I have come across a website that appears to use Ajax but does not
I have a problem that is common, but I am not quite sure exactly
Not sure how to phrase this question exactly, but I'll give it a shot.
Now I've seen some questions like this, but it's not exactly what I want

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.