Javascript: Saving the current path (cookie record) _ javascript skills

Source: Internet
Author: User
Once made a function to cancel the order. This function is available in the personal center and on the order details page. According to the normal idea, the two parts can be submitted to the same action for processing, but the returned pages are different. They can all be returned to the current page. Simply put, on the personal Center page, the customer clicks to cancel the order, submits the order to an action, performs database operations, and changes the field values in a table, then return to the personal Center page again, but the "cancel" button is changed to the gray "canceled" button, and the Order details page is the same, submit to the same acion, but the return page is not the personal Center page, but the order details page.

In this case, you can use js to save the current path, write it to the cookie, and obtain the path in acion. By using the get/set method, you only need Write the el expression of the path.

The Code is as follows:

The Code is as follows:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.