For the love of all that is holy, can you all please start using `` for navigation and `` for actions, not the other way around?
-
@mahryekuh I just clicked a "link" (or what I thought was a link) with Crtl + click and wondered why it wasn't opening in a new tab. I inspected it and saw it was a tr with an event.
This post directly came to my mind again. So I had to re-boost it. -
@thewhite969 That is super frustrating!
The weirdest thing is that it is literally easier to make an anchor with an href than to create another element and write JavaScript to fake a link. ️
-
The mastodon web interface doesn't let us right click to open posts in a new tab like other platforms including twitter did.
Apparently we have to squint or use a magnifying glass and find "2m" or "13days" and right click that.
-
@rzeta0 Yeah, Masto UI/UX has room for improvement.
-
Woozle Hypertwinreplied to Marijke Luttekes last edited by
@mahryekuh I only skimmed the blog post, so please tell me if I'm missing something -- but my impression has been that most instances of non-right-clickable links are because they're just JavaScript event-triggers with no real URL.
...which is kind of awful, but I suspect the frameworks people are using which do this kind of thing don't actually support URL-based navigation in the first place (which is worse).
(This is but one reason I strongly dislike JS-based web app frameworks and will only develop with them if given lots of money.)
-
Marijke Luttekesreplied to Woozle Hypertwin last edited by
@woozle That's part of it yes, and they will be mentioned in the article.
I also added "further reading" at the bottom for more technical depth.
-
@mahryekuh After reading your article, I have a question: why not button onclick="func" instead of the lengthy addEventListener logic? Thanks! Great post btw!
-
@sukiletxe That is an HTML purity thing and personal preference:
I do not like putting CSS or JavaScript in HTML, so I create JS bindings in JS instead of an `onclick` attribute.
-
@mahryekuh @sukiletxe Fwiw, those event handlers (onxxx) also require specific handling in a Content Security Policy, so yes addEventListener (and a strict, or as-strict-as-possible, CSP) please!
-
@tbroyer Thank you, good point!
Also, I had momentarily forgotten about the existence of CSPs, and I liked that. 🥲
-
@mahryekuh I did not know that is the reason why I sometimes can’t open in new tab!
Thanks for this, made me check my own website to ensure it’s working correctly.