返回上一页 [英] Go Back to Previous Page

查看:104
本文介绍了返回上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用表单对网页进行评分。此表单将数据发布到其他地方的php脚本。我只想在处理表单后显示一个链接,这会将用户带回上一页。我可以在我的php脚本中使用javascript执行此操作吗?

I am using a form to "Rate" a page. This form "posts" data to a php script elsewhere. I simply want to display a link after the form is processed which will bring the user back to previous page. Can I do this using javascript in my php script?

GF

推荐答案

您可以使用链接在Javascript中调用 history.go(-1),这实际上等同于单击返回按钮。然而,理想情况下,最好只创建一个返回URL的链接,从用户发布到表单的方式 - 这样就可以保留历史的正确流程并且用户不会想知道为什么他们有某些东西点击转发,实际上只是再次提交表单。

You can use a link to invoke history.go(-1) in Javascript, which is essentially equivalent to clicking the Back button. Ideally, however, it'd be better to just create a link back to the URL from whence the user was posted to the form - that way the proper "flow" of history is preserved and the user doesn't wonder why they have something to click "Forward" to which is actually just submitting the form again.

这篇关于返回上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆