How to Load a Digg Button After a Page Load

Digg is a website that allows users to vote and rank up pages based on content and interest. Visitors to a Web page click on a Digg button to place their vote for the page with the Digg system. However, if the Digg site becomes bogged down with traffic, a slowly loading Digg button may also cause a slowdown in your website loading time. Because of this, you can place the Digg button code at the bottom of your website HTML, which causes the button to load only after the rest of your site content displays.

Instructions

    • 1

      Open your website code in an HTML or online editor.

    • 2

      Locate the existing Digg button code in your HTML. The entire code looks like this:

      <script type="text/javascript">
      (function() {
      var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
      s.type = 'text/javascript';
      s.async = true;
      s.src = 'http://widgets.digg.com/buttons.js';
      s1.parentNode.insertBefore(s, s1);
      })();
      </script>

    • 3

      Highlight the code section, right-click and select “Cut” from the menu. This removes the code section from your site’s HTML page and places it in your computer’s temporary memory.

    • 4

      Search for the “</body>” tag in the HTML code. This is the tag that signifies the end of your HTML body content.

    • 5

      Right-click in front of the “</body>” tag and select “Paste” from the menu. This places the Digg button code as the very last content on your page, and allows all of your other content to load first.

    • 6

      Save the changes to your HTML code and post the updates to your site.

Related Searches:

References

Comments

Related Ads

Featured