I want to use a Facebook like/share button on my Images Website which uses a client side image JavaScript.The images are sourced externally(external image urls) and contained in array within script. To create a pageload with each image navigation, the image Script contains a CurrentURL function(dont exactly know what it is) and it changes website URL with each image navigation(suggesting that the images are hosted on my site). I have used custom share/like button (found it on stackoverflow and modified it) which shares the currectURL correctly on FB but fails to load the thumbnail image from pics array.
<script type="text/javascript">
var dynLike = document.createElement('fb:like');
dynLike.setAttribute('data-href', document.URL);
dynLike.setAttribute('picture', pics[a]); ( **i have added this for image thumbnail** )
dynLike.setAttribute('share', 'true');
dynLike.setAttribute('width', '450');
dynLike.setAttribute('show_faces', 'false');
document.body.appendChild(dynLike); // Or wherever you want it
FB.XFBML.parse();
</script>
The link to share/like in the above code document.URL (currentURl) comes from the image JavaScript I am using on my website. And pics[a] is image links in the array of image javascript.
Please help me with this, what changes can be done in this code to load the thumbnail image from pics array with current Url in the browser window.