Friday, December 19th, 2008
DLINK: automatic link annotation
David King has created a small JavaScript library dlink that styles your links to let the user know if the link is internal, external, a subdomain, an anchor on the same page, or an email link.
To setup, you can simply:
- <script type="text/javascript" src="http://oopstudios.com/dlink/dlink.js"></script>
- <!-- use class=dlink -->
- <div class="dlink">
- your <a href="#">link filled</a> content...
- </div>
- <!-- change styles
- a.internal {color: #D47700;}
- a.external {color: #0074D4;}
- a.subdomain {color: #D43500;}
- a.email {color: #00B235;}
- -->





4.3 rating from 41 votes
That is very cute!
Admirable as it is that David offers to continually update and host the script for the audience, I would recommend against hotlinking scripts from servers outside your control. It’d be extremely simple for David to create a specialized version of his script, specifically tailored for each site to steal the secrets of it’s audience.
Now, I doubt that David would do such a thing, especially after an honorable mention here, but can YOU or YOUR clients afford to take such risks?
Hosting it on your own servers, and skimming the source code before using it, you have no worries :-)
Good work David, looks really nice!
Awesome, I’m really rather happy I’m on here! Cheers Dion!
@MorganRoderick – I kinda agree with you about hotlinking scripts from relatively unknown coders (ie me), but when you consider that a good programmers career is largely based around trust and reputation it would be suicide to do something so bad. Consider AddThis.com, the Twitter API and the many stats scripts too, most of which I really respect.
With that said, I can hand-on-heart promise not to abuse the trust. And thank you for the kind words, it means a lot to me!
Oh also, the site is running on a rock-solid RackSpace server, so it’s not going to “go down” at any point ;-)
Congrats David. Its about time your work was recognized.
Morgan, you bring up valid points. However David has gotten me out of more than a few jams in my coding career. He’s about as real as they come. Still amazed at what this code can do! Thanks for sharing with “the rest of us”
con gradual ations jerone. looks like you put a lot of time into that. However we’re here to congradulate David. But thanks for sharing your link as well.
… great work there david.
Cheers for the heads-up jerome, I’ll definately take a good look through your coding and whatnot. I see on your site it says “I’m not sure if all works for everybody” Can I recommend running it through browsershots.org? If you see a pattern it’s usually pretty straightforward figuring out where the problem lies.
I am really excited by this! I just finished integrating dlink into my RSS reader, and it is really sweet (esp. on Ajaxian of course) seeing the favicons integrated with the link text; no more manual hovering!!!!
Also, integration was so painless I had to laugh (I render via XSLT) and dance the Jig!
I am making a release this week, just polishing off a few more defects for Xmas.
Thanks again so much!
Cheers escapellc! I appreciate your kind words!