javascript - Browser rollback, how to ensure that js operations on dom are saved
仅有的幸福
仅有的幸福 2017-06-26 10:54:39
0
3
654

1. There are multiple external links written on the homepage;
2. When you enter the homepage, a pop-up window will be displayed. When it is clicked to close, use the js click event to set the display of the pop-up window to none and hide the pop-up window;
3. Click to enter other link pages, and then go back through the browser's back button or Android phone WeChat. It will return to the homepage, but the pop-up window will pop up again. Is there any solution? After going back, you don’t want the pop-up window to be displayed, and it will be displayed as the state before the jump

仅有的幸福
仅有的幸福

reply all(3)
巴扎黑

Set a cookie, record the status, and enter the page to determine whether there is a cookie. If there is a cookie, there will be no pop-up window. If not, there will be a pop-up window.

扔个三星炸死你

As mentioned above, using cookies, jquery’s cookie is particularly simple. If you don't consider supporting IE browser, you might as well use h5's new features localstorage or sessionstorage.

阿神

Cookie, localstorage; there is also an event popstate that may be used in conjunction with history.pushState
cookie should be able to achieve the effect.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!