Facebook Like - Is There A URL You Can Call To Reply Like? (without FBML or iframes)

I want to add the “Facebook Like” functionality to the page without using FBML or iframe . Since I found this for the Share button, I thought this was a pretty easy solution:

<a href="javascript:window.location=%22http://www.facebook.com/sharer.php?u=%22+encodeURIComponent(document.location)+%22&#38;t=%22+encodeURIComponent(document.title)" title="Share on Facebook..."><img src="/path/to/your/image/" width="12" height="12" alt="alt" /></a>

It basically redirects the user to:

http://facebook.com/sharer.php?u=$url

So, I want the javascript function to call (more precisely: a url that you can call) to send my “how”.

+3
source share
2 answers

Ahh, URL-, "". , FBML iframe- "-".

0

javascript, ,

<script>
function likeMyPage()
{
  window.open("http://facebook.com/sharer.php?u="+window.location.href);
}
</script>

html

<button onclick="javascript:likeMyPage();" value="Do you Like me?" />

: http://developers.facebook.com/docs/reference/plugins/like/

, , . , , , facebook, .

0

All Articles