Go Back to Previous Page

前端 未结 11 688
悲哀的现实
悲哀的现实 2020-12-02 07:20

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 us

11条回答
  •  我在风中等你
    2020-12-02 08:01

    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.

提交回复
热议问题