I got one example from Google below:
Java script code:
function fbs_click()
{
u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
Html Code:
<a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>
Below is my question and coding:
I want to transfer the images url to two locations. I did one location for playing video, but another location to social image. I used on the nested repeater for image slider, when the user click on the image, then the video will play, as well as want to send the url to social image.
I used repeater.
<ItemTemplate>
<li>
<img src=' <%#Eval("ImageName") %>' alt='<%#Eval("ImgUrl") %>' width="130" height="100" onclick = "ChangeImage(this)" style="cursor:pointer;" />
</li>
</ItemTemplate>
I used Java script code:
function ChangeImage(getID,getfbshare) {
var targetID = document.getElementById("centralImage");
targetID.src = getID.alt;
var targetID1=document.getElementById("getfbshare");
targetID1.href=getfbshare.alt;
}
Below the video player one social image is there for sharing current link:
<a href="" target="_blank" id="getfbshare" onclick="return fbs_click()><img src="image/fb.gif" width="30" height="30"> </ a>