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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:50:10+00:00 2026-06-12T19:50:10+00:00

Here’s my scenario. When child is added via a browser event post page load,

  • 0

Here’s my scenario. When child is added via a browser event post page load, I want to indicate it in the title. But on page load, child added is called as well.

How can I differentiate the initial child added vs one where a new entry has been actually added.

Thanks, Tim

  • 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-12T19:50:11+00:00Added an answer on June 12, 2026 at 7:50 pm

    Firebase very intentionally does not distinguish “initial” data from “new” data. This allows for much simpler development in most cases, because you only have to write one set of logic for your data, rather than handling both the initial data case and the new data case.

    I can see how you would want the distinction in this case. I’m not sure exactly what you’re doing, but if you’re building a chat application, you might want to flash the title based on the timestamp of the most recent message rather than whether or not it’s a “new” message. This would allow the title to flash on page load if a message was sent slightly before the page was loaded, which may be desirable. In some other cases, you may actually want to flash the title for unread data, and you may want to consider marking children as “read” and flashing the title only for children that show up without the “read” bit. This would allow things to work seamlessly across page refreshes.

    If you absolutely need to know when “new” data shows up, you could try using “once” with a “value” event type to get the data, and then use “on” with a startAt query and a “child_added” event type to display new data after that. It would look something like this:

    var data = new Firebase(...);
    data.once("value", function(d) {
      //TODO: display initial state...
    
      data.startAt(null, <last id in snapshot>).on("child_added", function(newMessSnapshot) {
        //TODO: render new child and flash title bar.
      }
    }
    

    Or if you want to do it the really simple way, you could just set a timer so that the title won’t flash for any messages received within the first N seconds of page load.

    Hope that helps!

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

Sidebar

Related Questions

Here's what I'm doing. I want to upload multipart file via Ajax to my
Here the scenario is I have many .aspx pages if any page gives error,
Here is what I am currently doing. PHP echo's out the recent post in
Here is the scenario. I'm writing my geo-ruby oracle adapter for Ruby On Rails
Here's my search array: $aExt = array('png','jpg','gif'); I want to search through the variable:
Here is what I want to do. Use this HTML line and have the
Here is my problem : I have a post controller with the action create.
Here is my scenario. I have a website running under AppPool1 and that works
Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario: I'm writing an app that will watch for any changes

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.