I would like to ask you how to click the favorites button, the words "favorites" are displayed in the middle of the page, and the collection has been cancelled.

can you give me a detailed explanation of the train of thought, process and technology?
the key question is how to display words in the middle of the page

Mar.04,2021

if the front end is static, write a click event to directly determine whether the text has been collected, and if so, cancel it; otherwise, it will be collected.
if there is a front-end interaction, you need to pass a field to ensure that the data is refreshed directly


The

button has two states: [favorites] <-> [unfavorites]

when initializing the page, judge the current state according to the background data, and then assign a value to the innerHTML of the button

The

button binds the click event, reverses it according to the current state, and refreshes the interface that needs to be displayed

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37d8b-2c0d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37d8b-2c0d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?