šŸ“™ Understanding Neuronal Networks presale is now open - 20% off discount!

Create links and scroll to any text fragment in an HTML page without adding unique IDs

Din you know you can link to any text fragment in a web page, without adding an ID to that fragment? Because I didn't 😁

Just select any text from a webpage, right-click it, and pick Copy Link to Highlight:

The generated URL will look as this:

https://wicg.github.io/scroll-to-text-fragment/#:~:text=Automatically-,scrolling%20the,-passage%20into%20view

It seems that this feature was released some while ago, and Thomas Steiner has a great article about the API where it goes into more detail about how that URL was composed.

Note that Firefox still does not support scrolling to text fragments based on the URL parameters, while it works in all the other browsers.

Some while ago I made a script that would add a unique ID to each H2 of this blog so I could do deep linking. Just that this scroll-to-text fragment feature is much nicer, especially in the remote work context where almost all happens on Slack.

šŸ“– Neural Networks from Scratch - Presale

I'm writing a book about the timeless foundational concepts of neural networks for JavaScript developers. Go from if-else to weights and biases by building tiny AI models from scratch!

šŸ“– Neural Networks from Scratch - Presale

I'm writing a book about the timeless foundational concepts of neural networks for JavaScript developers. Go from if-else to weights and biases by building tiny AI models from scratch!


Leave a Reply

Your email address will not be published. Required fields are marked *