md_imran's avatar

Stay on same page while reload the page

Hello Ariisan, I have a long list of users viewing UI. I have use eloquent pagination for viewing each block 8 users. Problem is that, while I click on 'load more' it fetch 4 records then If i visit any users and return BACK by browser PREVIOUS BUTTOn , it does not stay on same position. It return to first page withou loading previous data.

Can you suggest me any solutions?

0 likes
5 replies
abrada's avatar

Button 'load more' is ajax button?

You need change url (add get parametr ?page=N+4) for every press button. after press button

jlrdw's avatar

Look at me chapter on redirects, there is a redirect back.

If someone hits back button there is little or nothing you can do about that.

wafto's avatar

In that case use like @traster100 says, control your page state with the query string.

martinbean's avatar

If i visit any users and return BACK by browser PREVIOUS BUTTOn , it does not stay on same position. It return to first page withou loading previous data.

@md_imran Yes. This is one of the reasons to avoid “infinite scrolling”. It’s awful from a UX point of view.

Please or to participate in this conversation.