Home >Web Front-end >JS Tutorial >js saves the current path (cookies record)_javascript skills
Simply put, on the personal center page, the customer clicks to cancel the order, submits it to an action, performs database operations, changes the field values in a table, and then returns to the personal center page, only there is a "Cancel" button It will be OK if it turns into gray "Cancelled", and on the order details page, it is the same, submitted to the same acion, but the return page is not the personal center page, but the order details page.
At this time, you can consider using js to save the current path, write it to the cookie, and get the path in acion. Through the get/set method, you only need to write in
The code is as follows:
So as long as the returnUrl is configured in the action, this problem can be easily solved without having to write two actions.