Home >Web Front-end >HTML Tutorial >Browser back button return problem_html/css_WEB-ITnose

Browser back button return problem_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:20:261193browse

I am currently working on a simulated e-commerce website.
There are many duplicate submissions. I have solved the repeated submission of the registration page, but the repeated submission of the order page is still being explored.
This problem is mainly caused by the browser's back button. After I have submitted the order, if I accidentally press the back button and then press submit again, will it be submitted again?
I wanted to avoid this problem, so I went to see how Dangdang did it. What I found interesting is that after I successfully submitted the order, the browser's back button returned the page to the shopping cart instead of the order page. I checked Dangdang’s order page and found that the address bar of the order page looked like this:
http://checkout.dangdang.com/checkout.aspx?shop_id=0#dd_refer=http://shopping. dangdang.com/shoppingcart/shopping_cart.aspx

The last string here is the address of the shopping cart. I would like to ask, does Dangdang use this method to avoid the problem of repeated submissions when the browser returns to the order page? Is there any hero who can help me explain the meaning of this address?

I don’t need to disable the browser’s back button. I have found a lot of that method on the Internet. I hope someone can help me explain this method of Dangdang.com. Thank you!


Reply to discussion (solution)

1. You can use ajax to submit
2. You can use Response.Redirect to a page after submission

3 , prohibit the browser from caching the page

The server controls the jump. For example, on the order page, if it is found that the order has been processed, then jump to the shopping cart

Thank you, no Sorry, I posted it late and forgot about it.
In the end, I used the method provided by wzs_xyz, although I think using ajax is also good.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn