Facebook Like / Share button for individual blog entry


(Bevan Ting) #1

Hi, I have a site using the Native Blog. I got the instructions from Facebook to paste the code to create the Like and Share buttons.

So far so good except that the URL shared is static and so I had to make it the main URL of my blog page.

Ideally, when someone clicks the “Share” or “Like” buttons, I’d like it to share or like the particular blog entry they were at.

The FB code says to do:

Does anyone know how to change “http://www.example.com” to a value returned by location.href instead?

Sorry I know nothing about JavaScript so I don’t know the syntax.

It’ll probably take a JavaScript expert 2 minutes to answer this.

Thanks in advance.


(Bevan Ting) #2

Don’t worry. I solved the problem myself!

After buying Cédric Giger’s book (only to find out how to do it), it appears all I had to do was leave the URL blank in the Facebook link generator tool and that’s it!!

Geez…if Facebook bothered to say that on their page it would have saved me a lot of time!