Autorefresh Facebook Concept

I want to ask you the concept of facebook auto refresh. Last time I using jquery and some js function in my page to get auto update. This work smoothly, if data receive it will automatically update the page and the data will show.

But now I have a trouble when I want to block text the content of auto update. Trouble is when want to block text and copy the content, we must quickly block it. If not, it will refresh again and reset your block text.

I just imagine is it possible if I want to make auto refresh like facebook concept. In facebook, I see it smoothly. In facebook concept, I block text of content, if auto refresh, It keep the block of text.

So how can I do that concept in my page ? Thank you.

Answers


I think you can store your text into a "queue" (maybe an array in js) And then display the content from your "queue"

Thus, you don't worry about the content will be reset.

example:

var queue =[];

function getfromserver(){
    $.get("url",null,function(resp){
           queue = queue.concat( resp );
    }, "json");
}

function displayTopFive(){
    // do block text
    var topfive = queue.slice(0,5); // if the length of queue is more than 5
    $.map(topfive, function(elem){
            //do display single block
    });
}

Need Your Help

Multiple PayPal applications and verifying payments

android ios mobile paypal

We are building multiple mobile apps (Iphone and Android). These are using the PayPal mobile SDK and we're verifying the payments on a backend. For each app we created a new application in PayPal, so

equivalent function of sub2ind in opencv

matlab opencv

Iam facing problem in understanding and converting a matlab code into opencv. I want to know is there any equivalent function of sub2ind as in matlab in opencv. Or how to implement in opencv this