@
@
@Twitt2017-06-01 16:35:35
JavaScript
@Twitt, 2017-06-01 16:35:35

Yii2 - how to work with pages without reloading using jQuery?

There is this item:

Working with each individual page must occur without reloading it using jQuery

It turns out, as I understand it, I have to click on each news, and the page with the news should be loaded using AJAX? How then to achieve this? I didn’t understand this point in the assignment at all, help mi pliz

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Fedorov, 2017-06-01
@qonand

It turns out, as I understand it, I have to click on each news, and the page with the news must be loaded using AJAX?

Yes
In the simplest case, you can use Pjax.

M
Maxim Timofeev, 2017-06-01
@webinar

yii2 has a Pjax widget based on the pjax plugin for jquery. It automates this process very simply.
Read the docs, I gave links and there are a lot of guides on the topic with detailed examples on the internet.

M
mitaichik, 2017-06-02
@mitaichik

And why is this necessary, what's wrong with rebooting? It just sounds like the customer wrote it into the TOR, because somewhere he heard that it was fashionable, without understanding the context, because the requirement, IMHO, is crazy, and I would try to dissuade the customer from him.
And on the topic - if something is simple - then PJAX can help out. Well, if you write a real complex one-pager, then you can’t do without Angular / React, you won’t go far with bare jQuery. But yii has nothing to do with it - it's from the frontend area, it's completely different...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question