https://github.com/iafan/linktoselection
Allow your website visitors to deep-link to any selected page content
https://github.com/iafan/linktoselection
bookmarking deep-linking javascript plugin
Last synced: over 1 year ago
JSON representation
Allow your website visitors to deep-link to any selected page content
- Host: GitHub
- URL: https://github.com/iafan/linktoselection
- Owner: iafan
- License: mit
- Created: 2016-03-07T20:17:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T23:04:36.000Z (almost 8 years ago)
- Last Synced: 2025-02-28T08:45:55.743Z (over 1 year ago)
- Topics: bookmarking, deep-linking, javascript, plugin
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
### About LinkToSelection
Sometimes you want to share a link that points to a specific text on a page, or an image.
This script, when plugged into a page, will do just that.
Upon selecting something on a page, you will see #sel:xxxxxxxxxxxx hash
added to the page URL. Send the resulting link to someone else, and they will open the
page with the same selection restored and scrolled into view.
### Best Use Cases
__Documentation__: enabling selection sharing this on your documentation website will allow you to point others to specific phrases or words.
__Reporting errors__: your users can send you links to typos or other kinds of errors that they find on your website pages.
### Demo
Try any of these links that point to a specific selected content on [serge.io](https://serge.io/) website:
* [Link to a phrase](https://serge.io/#sel:ZGl2L2Rpdi4yL2Rpdi4zL2Rpdi9wLjEvQDoxMDctKjoxNjQ)
* [Link to a section](https://serge.io/docs/dev/callbacks/#sel:I2JlZm9yZV91cGRhdGVfZGF0YWJhc2VfZnJvbV9zb3VyY2VfZmlsZXMvYS1kaXYvZGl2LjIvZGl2L2Rpdi4xL3AuNy9ALjE6MTIw)
* [Link to an image](https://serge.io/docs/localization-cycle/#sel:ZGl2L2Rpdi4yL2Rpdi9kaXYuMS9wLjItKjox)
### Usage
Just put the `LinkToSelection.min.js` file to an appropriate folder of your website, e.g. `/static/js/vendor/` and add the following script to the bottom of your web pages (before the closing `