A
A
arti_djeims2015-09-17 00:28:17
PHP
arti_djeims, 2015-09-17 00:28:17

How to make comments from facebook in real time?

I added comments from fb to my site but they are not in real time, I need to refresh the page, is there any way to solve this problem so that it would show new comments without refreshing the page? If someone does not understand, I'm talking about this widget https://developers.facebook.com/docs/plugins/comments

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Teterin, 2015-09-22
@errogaht

You can make a separate file that will contain only the widget code, for example fb.php
Make it on the page where the widget should be displayed - container
And make auto-update on JS at specified intervals via AJAX, like:

setInterval(function(){
    $.get("fb.php", function(data){
        $("#fb").html(data);
    });
},1000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question