Facebook "Like" Social plugin Ampersand Error

I am trying to implement the facebook button as "mine", but I have a problem when my URL has "&". in that. I tried to use htmlentitiesas well urlencode(which works closest, but not quite).

I have a url like: example.com/entry.php?id=1&refer=abcand I am coding the whole thing for href for iframe for a social plugin button that becomes:example.com%2Fentry.php%3Fid%3D1%26refer%3Dabc

Now, when I load a page with this button and click “like,” it shows me the correct URL “ example.com/entry.php?id=1&refer=abc”, but then it says an error next to it, click the error message, and I get this error:

Page example/entry.php?id=1&refer=abccannot be reached.

So for some reason it interprets as amp? amp, how does that make sense?

Thoughts?

+3
source share
1 answer

What I would do is use the XFBML version and use the Open Graph Meta Tags so that you set the URL in the og:urlmeta tag and leave href empty!

When done, run the link above the Linter URL to clear your Facebook cache.

+1
source

All Articles