How to make changes to HTML document permanent using Javascript?

前端 未结 3 1653
误落风尘
误落风尘 2021-01-13 14:16
  1. I have a simple like counter code, but the changes made disappear after the page is refreshed.

  2. Why does this happen, should this be done using PHP ?

3条回答
  •  悲哀的现实
    2021-01-13 14:59

    I suggest looking to cookies if you want to keep track of information across page reloads in a simple way. If you want the information to be available to anybody other than the user who created it, you'll likely need some form of server-side persistence such as a database.

提交回复
热议问题