Results 1 to 2 of 2

Thread: Changing "Digg This" anchor

  1. #1

    Changing "Digg This" anchor

    I recently signed up for an account at Digg and was looking through their "Digg Tools" for websites and it seems that the only way to add a "Digg This" icon/link is to use their code which is javascript and it adds the default "digg this" with the number of diggs button.

    I've seen all kinds of variations of this on websites, but I can't see on the digg site what anchor to use if I want to use one of the other icons/images they give you. Instead of "<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>" I would assume something along the lines of <a href="URL_here" /></a> and then I can style the anchor accordingly in the CSS to apply a different image.

  2. #2
    Site Contributor KLB's Avatar
    Join Date
    Feb 2006
    Location
    Saco Maine
    Posts
    1,181
    The boiled down code I use for my "Digg this" is:
    Code:
    <script type="text/javascript">
    var desc;
    if(!document.getElementsByName('DESCRIPTION')){desc='';}
    else{desc=document.getElementsByName('DESCRIPTION')[0].content;}
    var t=document.title;
    t=encodeURIComponent(t);
    </script>
    <a href="http://digg.com/submit" onclick="window.open('http://digg.com/submit?phase=2&url='+encodeURIComponent(location.href)+'&title='+t+'&bodytext='+desc, 'Social','height=440,width=700, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, directories=no, status=yes'); return false;"><img src="http://{Your domain name}/images/digg_16x16.gif" alt="">Digg</a>
    The beauty of the code is that it doesn't have to be modified from page to page, Javascript figures out the URL, title and description for you. The one catch is that the word "description" in "document.getElementsByName('DESCRIPTION')" needs to match the case you use for your meta description tag.
    Ken Barbalace - EnvironmentalChemistry.com (Environmental Careers, Blog)
    InternetSAR.org: Volunteers Assisting Search and Rescue via the Internet
    My Firefox Theme Classic Compact: Based onFirefox's classic theme but uses much less window space

Similar Threads

  1. Changing Domain Names
    By asphalt in forum Domain Names
    Replies: 3
    Last Post: 04-22-2005, 01:01 PM
  2. Losing anchor text benefits
    By Kyle in forum Search Engine Optimization
    Replies: 2
    Last Post: 10-01-2004, 08:22 AM
  3. Anchor Text Curiosity
    By mobilebadboy in forum Search Engine Optimization
    Replies: 2
    Last Post: 07-21-2004, 04:52 PM
  4. Anchor Text Question
    By cameron in forum Search Engine Optimization
    Replies: 29
    Last Post: 07-17-2004, 09:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •