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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:56:09+00:00 2026-05-25T18:56:09+00:00

Facebook has introduced a ticker which shows live news scrolling down. How can I

  • 0

Facebook has introduced a ticker which shows live news scrolling down. How can I have this same time of functionality on my site? I don’t care to use an iframe and have it refresh because it will A flicker and B make the page loading icon come up (depending on browser). How can this be done?

  • 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-25T18:56:09+00:00Added an answer on May 25, 2026 at 6:56 pm

    For this you’d want to fetch the data you’re looking for with AJAX every X seconds.. Also known as polling.

    Here’s the break down: Every X seconds, we want to query our database for new data. So we send an asychronous POST to a php page, which then returns a data set of the results. We also declare a callback function (native to jQuery) that will be passed the data echo’d from our PHP.

    Your PHP:

    if (isset($_POST['action'])){
        if ($_POST['action'] == 'pollNewData'){
            pollNewData();
        }
    }
    
    function pollNewData(){
        $term = $_POST['term'];
        $sql = "select * from TABLE where TERM = '$term'";
        $result = get_rows($sql);
        echo json_encode(array('status'=>200, 'results'=>$results));
    }
    

    Your front end javascript:

    setTimeout(pollForNewData, 10000);
    
    function pollForNewData(){
        $.post('url/ajax.php',{
            action: 'pollNewData',
            term: 'your_term'
        }, function(response){
            if (response.status == 200){
                $.each(response.results, function(index, value){
                   $("#container").append(value.nodeName);
                });
            }
        }, 'json');
    }
    

    What essentially is going on here is that you will be posting asynchronously with jQuery’s ajax method. The way you trigger a function in your PHP would be by referencing a key-value item in your post depicting which function you want to call in your ajax request. I called this item “Acton”, and it’s value is the name of the function that will be called for this specific event.

    You then return your data fetched by your back end by echo’ing a json_encoded data set.

    In the javascript, you are posting to this php function every 10 seconds. The callback after the post is completed is the function(response) part, with the echo’d data passed as response. You can then treat this response as a json object (since after the function we declared the return type to be json.

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

Sidebar

Related Questions

To be precise, you guys may have noticed that facebook has this component placed
UPDATE: Facebook's API has changed a lot since this question was posted. This question
a client has asked me for a Facebook application similar to a news reader,
My app has normal users: those which come through a typical signup page facebook(FB)
I am building a web application that has a real-time feed (similar to Facebook's
As I know Facebook has embraced Open ID but I can't find the url
It seems like facebook has this mastered, I've checked a bit into WURFL but
** Looks like this was a bug that Facebook has since fixed. I disabled
I am new to this Facebook coding game so have stumbled upon a fault
Does anyone out there have a working example of the Facebook live stream plugin

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.