Home > front end >  Page back or retreat, can maintain the original page, the request data is retained
Page back or retreat, can maintain the original page, the request data is retained

Time:09-19

I do is a webapp, for example, I was in a page click enter a keyword query, I am using an ajax request, the request is successful, the return result I did paging processing, because it is a mobile terminal access, so the slide to the bottom trigger request page information, when I slide a lot of pages, see page 5 certain information, click go in to see details jumped to page b, then I returned to a page in the page b, a page is reloaded, all the results are not
Now I demand is returned to a page, page to keep information when I click on page 5 the position, and there are also five pages results in front of

CodePudding user response:

Jump b pages returned to save data in storage under try see have data to render

CodePudding user response:

window.history.back();

CodePudding user response:

reference 1st floor zzgzzg00 response:
redirect page b before returned to save data in storage under see how data will render try


Concrete methods about how to use the storage for the ajax request also in, and then slide down when can continue to load the content of the page 6

CodePudding user response:

Hello, you this how to solve the problem? Please give advice or comments

CodePudding user response:

Can you tell me the problem how to solve

CodePudding user response:

CodePudding user response:

Directly to the window. The history. The go (1) to go? No, ajax requests data on page, then the value of the scroll to write down the slide.

CodePudding user response:

In routing the jump in the previous step, you can use vuex or sessionStrage store the current request to the data, the request condition, the current node scrollTop, returned from the child pages, and reads the stored data, write page, at the same time the scrollTop of node assignment, so you can make the page, maintain its position in the original view, the jump to other pages don't need to keep the current page data, remember to destroy vuex or sessionStrage stored data

CodePudding user response:

First return from b a is how to return? Is equivalent to the browser's forward/back button return or jump way back? If you want to save a page is changeless, return is used when a call history way return, window. The history. The go (1)
  • Related