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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:23:06+00:00 2026-05-18T05:23:06+00:00

Although this has been discussed many times here in Stackoverflow, I couldn’t get the

  • 0

Although this has been discussed many times here in Stackoverflow, I couldn’t get the loader gif to display in Google Chrome. In Firefox 3.6, the code I have below works just fine for displaying the little gif whenever I make an ajax call but the same code won’t display anything if working with Google Chrome. Since our customer uses Chrome I have to make sure it is compatible.

Here is the jQuery code which is inside the onLoad event:

var loader = $('<div id="ajax-loader" class="ui-corner-all"><span></span></div>')
                .appendTo("body")
                .hide().ajaxStart(function() {
        var relativeToDocument = false;
        var parent = loader.parent();
        loader
                    .css("top", (relativeToDocument ? $(window).scrollTop() : 0)
                                + (parent.innerHeight() / 2)
                                - (loader.height() / 2))
                    .css("left", (relativeToDocument ? $(window).scrollLeft() + parent.offset().left : 0)
                                 + (parent.innerWidth() / 2)
                                 - (loader.width() / 2))
                    .show();
                })
    .ajaxStop(function() {
                loader.hide();
    });

Does anyone know why it isn’t displayed for chrome?

EDIT: Adding some of my markup below;

The css for the gif is here:

#ajax-loader { position: absolute; padding: 10px; }
#ajax-loader span { background-image: url("../images/ajax-loader.gif"); width: 32px; height: 32px; display: block; }

The page is here. Of course it looks bad because I haven’t added the css files and other things. Plus, this is a MVC application so you won’t have any data to load.

  • 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-18T05:23:06+00:00Added an answer on May 18, 2026 at 5:23 am

    Whenever I have some cross-browser issues I think about markup first, then code. I’d suggest to run a validation (http://validator.w3.org/) and see what you find.. Also, if possible, attach part of your html markup so we can test it as well – nothing like team debugging 🙂

    wait, I just noticed the div is empty, that means you must have used css to position the gif (background image?), please attach the relevant styling as well

    edit:

    1. OK, I took the liberty to fix the
      errors jslint pointed out (even
      meaningless semicolons) and forked
      it to a new jsFiddle
      . Notice how
      i stacked most of the js in 1 place.
    2. Also, chrome should have a built-in
      “debugger” like firebug in firefox,
      maybe you can see the errors that
      comes up there as well.
    3. Lastly, I know this is probably
      annoying to hear, but I really do
      suggest seperating styling, js code
      markup completely for better
      readability, and please try w3 validator
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has been an age old question and I am aware of the usual
Although this question and this question are close to what I'm asking, I believe
I've seen this format used for comma-delimited lists in some C++ code (although this
I have a HashMap (although I guess this question applies to other collections) of
I've actually asked about this already in this post although we've gone back to
Although somewhat related to this question , I have what I think is a
Although I don't have an iPhone to test this out, my colleague told me
Although I do understand the serious implications of playing with this function (or at
[This is for PC/Visual C++ specifically (although any other answers would be quite illuminating
Using PyCrypto (although I've tried this in ObjC with OpenSSL bindings as well) :

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.