4 ms·
I totally agree with the post, linking is somewhat broken. In our application (https://codeable.io https://codeable.io), we have a table with tasks, where each
by tzaman 14y ago
I totally agree with the post, linking is somewhat broken. In our application (https://codeable.io https://codeable.io), we have a table with tasks, where each row links to the single view for the task. Inner wrapping each <td> didn't really "feel" right, so I just went with javascript approach, having data-link attribute on each table row, then redirecting the user on click.
I know you might ask what about graceful degradation?, but the truth is our app relies heavily on javascript (websockets) to work, as 90% of modern apps/sites do, so we decided to ignore it. We don't like that, but something's got to give.
- scott_w 14y agoOne form of "graceful" degradation that we're considering is to have a single <td><a href="">Content</a></td> on each row that users can click when JavaScript is disabled. Users with JS get <tr data-href=""><td><a href="">Content</a></td></tr>, with JS doing as in your example. The downside is that we'd have to repeat ourselves, but at least the system will degrade somewhat-gracefully.
- tzaman 14y agoThere is not such thing as somewhat-graceful. Either it degrades or it doesn't :)
- jdavid 14y agothe larger problem with javascript linking is, the 'new tab' problem. On windows and linux center clicking the mouse on a link opens a new tab and does not focus on it. most javascript does not simulate this behavior.
- Tloewald 14y agoThis is a good point and does actually show that allowing hrefs in any tag could be a solution where an anchor won't do. Also you cannot simulate right click options as you'll either get a new tab or a new window at best.
- ksherlock 14y agoWhat if you dynamically insert an a element on the mouse-down event?