476
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 01 Aug 2024
476 points (99.2% liked)
Technology
60123 readers
2591 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related content.
- Be excellent to each another!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, to ask if your bot can be added please contact us.
- Check for duplicates before posting, duplicates may be removed
Approved Bots
founded 2 years ago
MODERATORS
That's actually pretty simple to do. I don't know if this is how they did it, but one way is just creating an tag with the href to google.com. that'll show the destination if you hover over it. Then you just add an event listener to the click event, prevent the default event from executing, and manually redirect somewhere else.
Made a quick example: https://codepen.io/Ghoelian/pen/poXeOyo
Yes, but ads shouldn't have that level of control. They should provide an image or video and a link.
Oh absolutely. I kinda feel like preventing the default action on a tag like that should just not be allowed, or browsers should not display the target link thing if it has an event listener attached or something.