Cette page n'est pas encore traduite. Version anglaise
Tooltips for your site
How to put ForeverDB's item and spell tooltips on your own site with one line of HTML: the snippet, how to link, the three options, behaviour on phones and what the script sends. Last checked 30 November 2026.
Open the page this help is about
What it is
One line of HTML makes every link to a ForeverDB item or spell on your page show the same tooltip as on ForeverDB, from the WoW Forever client's data. It stays current as the client changes. It is free, and needs no account or key.
Who it is for
People who run a guide, blog, fan site or forum template and can add a script tag. Places that do not run other people's scripts, such as Reddit, Discord and most forum posts, cannot use it, but ForeverDB links there still get a preview card. Developers who need data as JSON want the API instead.
Step by step
- Open the Tooltips for your site page.
- Under Add it to your page, tick the options you want: Icons, Quality colours and Rename links. The snippet changes as you tick.
- Press Copy.
- Paste the snippet once in your page, or in your site's template, just before
</body>. - Add links to ForeverDB items and spells, as described below. Hover a link, or tap it on a phone.
The snippet looks like this: <script src="https://foreverdb.net/embed/tooltips.js" data-icons="true" data-color-links="true" async></script>. It works anywhere you can add a script tag: your own site, a WordPress theme or a Custom HTML block, a guide site or a forum's templates. Load the script from foreverdb.net rather than copying it. It fetches the matching renderer and data from ForeverDB, and ForeverDB keeps it compatible.
The page has a demo that runs the real script on a pretend page with items and spells to hover.
Linking
Link to items and spells the way you already would. The script finds links to https://foreverdb.net/item/<id> and https://foreverdb.net/spell/<id>, with or without www., and with anything after the ID (?... or #...). It also finds any element with data-foreverdb="item:<id>" or data-foreverdb="spell:<id>", for text that should not be a link.
The ID is the number at the end of an item or spell page's address on ForeverDB. Links added to the page later, such as comments, infinite scroll and single-page apps, work too.
Every option
Tooltips always work. These three extras are off unless you turn them on.
| Option | On the script tag | What it does |
|---|---|---|
| icons | data-icons | Shows the item's or spell's icon in front of the link. |
| colorLinks | data-color-links | Colours item links in their quality colour (green, blue, purple, orange). On light pages the colours are darkened so they stay readable, and common items keep your own link colour. |
| renameLinks | data-rename-links | Makes the link text the item's or spell's name, so a pasted bare link reads "Shadowfang". |
Set them in whichever way suits your site.
- On the script tag, as in the snippet:
data-icons="true". - In a script before it:
window.ForeverDBTooltips = { icons: true, colorLinks: true };. - For one link, or one part of the page, on the link or anything around it:
data-foreverdb-icons="false",data-foreverdb-color-linksordata-foreverdb-rename-links. These win over the page-wide setting.
Phones, tablets and keyboards
- On a touch screen, the first tap on a link shows its tooltip, a second tap opens the link, and a tap anywhere else closes it.
- Tabbing to a link shows its tooltip too, and the Esc key closes it.
- The tooltip keeps to the screen, so it fits a phone.
Privacy
- No cookies, no local storage, no analytics and no ads. The script loads nothing from anyone but ForeverDB.
- It only looks at links to ForeverDB, and only sends ForeverDB the IDs of the items and spells in them. Requests for data and icons are sent without a referrer, so they do not say which page they came from.
- Nothing is fetched until someone hovers or taps a link, unless you turn on icons, colours or renaming. Then the names and icons of the page's ForeverDB links are fetched when it loads.
- Like any website, ForeverDB's hosting providers handle the requests. See the privacy policy.
For developers
- The tooltips are drawn by the same code and stylesheet as ForeverDB's own, inside a shadow root. Your page's CSS cannot change them, and ForeverDB's never touches your page. The script adds one global,
ForeverDBTooltips. - After changing options from your own code, call
ForeverDBTooltips.refresh().ForeverDBTooltips.hide()closes an open tooltip. - If your site sends a Content-Security-Policy, allow
https://foreverdb.netinscript-src,connect-src,img-srcandfont-src.
What to expect
If ForeverDB is slow or down, your links stay ordinary links. The script shows Loading..., gives up after a few seconds and tries again on the next hover.
Common problems
No tooltip appears
Check the link points to foreverdb.net/item/<id> or foreverdb.net/spell/<id> with a real ID, the script tag is on the page, and your Content-Security-Policy allows https://foreverdb.net. Links on Reddit, Discord and most forum posts cannot run scripts.
The demo says it could not load the script
Reload the page. The demo runs the real script from foreverdb.net.
The link text did not change to the item's name
Renaming is off unless you tick Rename links and use the updated snippet, or set data-rename-links="true".
A tooltip shows the wrong colour
With Quality colours on, common items keep your own link colour on purpose, and colours are darkened on light pages.