Go Back to Previous Page

前端 未结 11 658
悲哀的现实
悲哀的现实 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:00

    If your web-server correctly redirects you to a new page after you made a post, the regular "back" button on the browser will work. Or the "history.go(-1)" in javascript. This will produce a filled out form.

    However, if the server just returns new content without redirecting - then history.go(-1) is not going to help you. At that point you have lost your form.

    If you just want to simply go back to the previous url - just link to it with an A HREF tag. That will show you an empty form.

提交回复
热议问题