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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:29:52+00:00 2026-06-14T05:29:52+00:00

In my app, there are different user accounts. What I’m trying to do is,

  • 0

In my app, there are different user accounts. What I’m trying to do is, show a loader.gif till the time .fetch() is fetching the content from resource url + rendering the views and hide the loader when fetching is done.

Now, when a user logs in, his list of TODO items
is fetched by Todos.fetch and on success callback, loader.gif fades out.

$("#app").hide();
$(".loader").show();
Todos.fetch({
    success: function(){
            $("#app").show();
            $(".loader").hide();
        }
});

This works fine for all user except those which have no Todo items. For these users, success callback is not triggered and loader.gif stays. Is there any other way to hide the loader.gif?


It seems to me that success function is called only when even a single model is added to the collection. If there is nothing to add to the collection, success isn’t called.

  • 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-14T05:29:53+00:00Added an answer on June 14, 2026 at 5:29 am

    BackboneJS fetch delegates to sync. sync returns a jqXHR object for your own use.

    You could just:

    Todos.fetch({
        success: function(){
                $("#app").show();
                $(".loader").hide();
            }
    }).always(function() { $(".loader").hide() });
    

    You can read more about it in this blog post.

    Apart from that, make sure that your server returns a valid json when the collection is empty. If the response is not a valid json you will get a failure.

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

Sidebar

Related Questions

I want to local notifications inside my iPhone app. There are different categories by
I'm developing an app in which there's hundreds of different calculations involved and would
In my app there is a button, user just click it then the latest
I'm testing several user accounts and don't want to setup different emails to test
I'm trying to figure out to have multiple facebook accounts tied into my app.
Another question from an app programmer who's trying the first time to get together
I have developed three different versions(as different projects) of an app(large,normal,small). How can I
I'm building an app for a group of three different societies. Each society of
I have an Android project that branched into three different applications, app-1 , app-2
I have an app with several different tabs. The first of these tabs should

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.