如何从跳转到刚访问过的页面?

黑马 2003-10-17 12:31:56
有一个搜索结果页面或多页的页面,我现在在某一页,然后我打开别的页面,怎么才能返回到刚才访问的某一页的页面?

可能打开了多个页面,所以不建议使用history.back()
可能是帧结构

一般是怎么样处理的?
...全文
43 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
黑马 2003-12-19
  • 打赏
  • 举报
回复
up
stefli 2003-10-17
  • 打赏
  • 举报
回复
history.back(-1)
emu 2003-10-17
  • 打赏
  • 举报
回复
一般都是
history.back()
history.go(-3)

如果要访问指定帧的前一个页面可以试试访问该帧的
document.referrer
不过这样只能得到页面地址,提交的页面参数就丢了。
zhfkiller 2003-10-17
  • 打赏
  • 举报
回复
back Method

--------------------------------------------------------------------------------

Loads a URL from the History list.

Syntax

history.back( [iDistance])
Parameters

iDistance Optional. Integer爐hat specifies the number of URLs to go back. If no value is provided, the previous URL is loaded.

Return Value

No return value.

Remarks

This method performs the same action as when a user clicks the Back button in the browser. The back method works the same as history.go(-1). An error does not occur if the user tries to go beyond the beginning of the history. Instead, the user remains at the current page.

黑马 2003-10-17
  • 打赏
  • 举报
回复
我就想要保留参数,如果只是一个url地址没有参数的话,现在就可以实现了!

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧