Hi,
I'm pretty sure this is impossible without having some user authentication, but has anyone figured out a way to allow people click a link one time, but then hide or disable the link so they cannot click again?
I think javascript can be leveraged to do this based on user cache, but refreshing or reloading the page will clear it and make the link clickable again. Wondering if there are any other ways or tricks to achieve this.
Thanks!
How to make a link clickable once per person
Re: How to make a link clickable once per person
If it has to be 100% robust, then yes you do need user authentication - as you'd need to record (at your end) if a user has clicked the link.
If it's for something that doesn't matter very much, then you could use the browser storage (localstorage or sessionstorage) or cookies to record if a user clicked the link. So that could work for a user on one device until they cleared their browser cache (or used a private browsing mode).
So you could use localStorage to (a) save a bit of data when the user clicks a link, and (b) check if the data exists in localstorage and show/hide the link as appropriate.
https://www.w3schools.com/jsref/prop_wi ... torage.asp
If it's for something that doesn't matter very much, then you could use the browser storage (localstorage or sessionstorage) or cookies to record if a user clicked the link. So that could work for a user on one device until they cleared their browser cache (or used a private browsing mode).
So you could use localStorage to (a) save a bit of data when the user clicks a link, and (b) check if the data exists in localstorage and show/hide the link as appropriate.
https://www.w3schools.com/jsref/prop_wi ... torage.asp