View Full Version : Facebook Share Button on .epub book


oren
12-04-2011, 04:27 AM
Hi.
I'm using this code for adding share button to my ebook (epub):

<div id="fb-share" dir="rtl" style="float:right;">
<a name="fb_share" type="icon_link" share_url="http://www.yetsiot.co.il/"><img alt="fb" class="fb" src="../Images/fb.png" />שתף</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
type="text/javascript">
</script></div>

It works when opens as a web-page but when using epub-reader (FF, IPhone, Android...) it just show the title but it's not clickable...

Any idea why? And how to fix that?

Thanks,
Oren

Jellby
12-04-2011, 05:16 AM
First, do not use "name", it should be "id" in XHTML.

Second, you don't have an "href", the link needs a target "href" property (and I bet "share_url" is not supported either).

Third, <script>, while not forbidden, is almost guaranteed not to work.

Fourth, many ePub readers have no Internet connection, and some of those who have cannot connect to the Internet from the reader application.

oren
12-04-2011, 05:32 AM
Hi,
Can you please help me with the right code? One which will work?
Secondly, I just found out that when using 'Android' I can't see the link at all...
Is there a difference between the two? Is there a way to make sure it looks well on all systems?

Thanks again :)
Oren

Jellby
12-04-2011, 06:01 AM
Can you please help me with the right code? One which will work?

I don't think so. It seems the code relies on the <script>, which as I said will not generally work in ePub readers.