Using on a Web Page
All you need are either skipto.js
or skipto.min.js
from the “/dist/” directory of this repository. The skipto.min.js
script is a minified (a lighter version) of skipto.js
script.
CDN Service
The easiest way is to include a reference to skipto.min.js
on your HTML page or template is through the CDN service, as follows:
github.com CDN service:
<script src="https://skipto-landmarks-headings.github.io/page-script-5/dist/skipto.min.js"></script>
NOTE: CDN referenced files may not be available to computers behind firewall protected networks.
Local File on Your Web Server
Copy the skipto.js or skipto.min.js to the file system of your web server and reference it from your web page or templates using a script
tag, as follows:
<script src="https://[path to Javascript files]/skipto.min.js"></script>
Warning Messages
The following warning messages may be rendered to the console:
Message | Action |
---|---|
Skipto is already loaded | Additional SkipTo’s are ignored |
No headings found in main | Searches for headings anywhere on the page |
No headings found on page | SkipTo menu reports no headings on the page |
No landmarks found on page | SkipTo menu reports no landmarks on the page |
Error in heading configuration | Sets configuration to look for any h1 of h2 headings |
Error in landmark configuration | Sets configuration to look for main search and navigation landmarks |
Unsuported or deprecated configuration option “abc” | “abc” option is ignored and/or default setting is used |
Feedback and Reporting Issues
We welcome your feedback! Please do not hesitate to raise issues and comment on Github if something doesn’t work or you have ideas on how to improve the script.
Happy skipping!