Facebook Share Buttom custom redirect

359 views Asked by At

I have a problem. I have a code share button on facebook because I want to share my blog posts. But a problem of logic makes me just get to share my posts if I "get them". example: In my main page (www.blog.com) posts all have the share button. Taking example, in the summary screen appears POST1. Still in all, I put the share button for easy access. That way the person need not open the post to see the buttons. However, if I click on any of the buttons that appear through the main screen, the button will share the link (www.blog.com) and not the post. To share a post I need to click on the post to open the link it (www.blog.com/post1) and finally click the same button to share it (www.blog.com/post1), I believe it is because of "location .href ".

Anyway, my goal was to share the posts without having to extend them, a logical type: share through the address where that button is written, rather than sharing the button where the page is in the browser.

<a href="data:post.url" onclick=" window.open( 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href), 'facebook-share-dialog', 'width=626,height=436'); return false;" >
<img border="0" src="http://imagizer.imageshack.us/v2/xq90/538/xKHv0R.png"></img >

Thank you

0

There are 0 answers