Typically when you decide to share a link on Facebook it reads through the meta tags on the page the link points to in order to obtain thumbnails and other information to display in the post. Unfortunately it’s hard to meta tag each and every HTML page if you a) have a flash site or b) a site where everything is being generated on the fly – e.g. everything runs off of index.php
After much digging (I take no credit for this) the following JavaScript based share allows you to specify everything for your share:
function shareFacebook(title,summary,image, link){
http://www.facebook.com/share.php?s=100&p[title]=”+encodeURI(title)+”&p[summary]=”+encodeURI(summary)+”&p[images][0]=”+encodeURI(image)+”&p[images][1]=”+encodeURI(image)+”&p[url]=”+encodeURI(link)
}
For some reason if you need to share one thumbnail, you need to specify images at index 0 & 1. For more thumbs, just continue to add more images to the [images] array.
Tags: facebook share, javascript, share