简体   繁体   中英

How can we see “Previous Page Result” if user go from one page to another & another

Suppose I have an application in which user searching an item & then search that item category , subcategory & availability in country. Or next he search another item Same as all browser back button works. 到的所有与所有浏览器后退按钮相同。

So kindly suggest me how can I do that. Any suggestion really appreciate.

Please try this solution :

<script type="text/javascript">
function goBack()
{
window.history.back()
}
</script>

<input type="button" value="Back" onclick="goBack()">

The back() method loads the previous URL in the history list. This is the same as clicking the Back button or history.go(-1).

如果会话具有值,则可以将值存储到浏览器会话并重新加载页面,然后从会话或搜索结果中获取。

You can access browser history from javascript using history object

window.history.back()

will bring you one step backward(previous page) and

window.history.forward()

can access next page from there.

length will returns the number of URLs in the history list.

Example:

<script>
function goBack() {
  window.history.back();
}
</script> 

<input type="button" value="Back" onclick="goBack()">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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