Display news list

Hello. Such a question: the page displays news from the news database. It is necessary that the listing be done without reloading the page. I think I got the main idea…
Would love to see an example or some documentation related to the topic. Thank you in advance!


Answer 1, authority 100%

I have implemented different types of loaders in my projects, see if you like something, then I can explain how and what works. Here are examples: zort.ru, darlabel.com, uniup.ru. Climb the sites, there are many where the content is loaded with Ajax.


Answer 2, authority 50%

I can suggest looking at this article: dynamic loading of data on the page. An example of loading comments on the page is given, if you remake it a little, you can achieve the output of news as a listing.


Answer 3, authority 50%

Well. You are correct in the tags. For example, like this, with pages. If you want an “infinite” listing in the style of VKontakte, then you need to track object offsets and screen size, and load and .append(data)as it approaches the end.

function getNews(page) {
    $.ajax({
        url: 'news.php?page=' + page,
        success: function (data) {
            $('#news_div').html(data);
        }
    });
}

In PHP, don’t forget to do $page = intval($_GET['page'])before putting it into a request.
This is if the general idea.