简体   繁体   English

刷新后返回

[英]Go back after refresh

I have a page with checking of a serial number (it doesn't matter). 我有一个检查序列号的页面(没关系)。 After checking number this page refreshes. 检查编号后,此页面刷新。 I have a back button on the page and I need via this button go back to previous open page, not on page where I was when I tryed to check this number but the page which was before. 我在页面上有一个后退按钮,我需要通过该按钮返回上一个打开的页面,而不是我尝试检查此数字时所在的页面,而是以前的页面。 When I use history.back() browser showes me error. 当我使用history.back()浏览器显示错误。 How it can be written with jquery to work? 如何使用jquery编写它才能工作?

If I understood well, you want to go back two times in window history with that button in the refreshed page... 如果我很了解,您想使用刷新页面中的该按钮go back two times in window history ...
right? 对?

If so.. then you need: window.history.go(-2) 如果是..那么您需要: window.history.go(-2)

History: 历史:

---------   ---------   ---------
|   1   |   |   2   |   |    3    |
| start |-->| check |-->|   page  |
|       |   |  snº  |   |refreshed|
|       |   |   &   |   |         |
|       |   |  page |   | button------
|       |   |refresh|   |         |  |
---------   ---------   -----------  |
    ^________________________________|
           window.history.go(-2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM