Facebook Share

By adamisanut Last update Jul 3, 2008 — Installed 272 times.


Script Summary: Share a page on Facebook

Script Details

  • Assigns part of a hard-coded URL to a variable.
  • Creates an <a> element with the DOM document.createElement() function.
  • sets the href of the <a> element to the hard-coded URL
  • inserts the <a> element into the document before its firstChild

Excluded Pages

I didn't think about this when I started writing this script, but sites such as YouTube and some blogging software already have links to share pages using Facebook. Also, after you install this script, you should exclude Facebook, because it already has the share links built in.