How do I use: http://graph.facebook.com/?ids=http://www.sitename.com
to return the current page's number of likes on a dynamic page? I'd like to pull the URL from somewhere and output the number on the page and allow me to use the variable for ot开发者_StackOverflowher things too.
You can use a Javascript framework like JQuery to make an AJAX call to this url. The response will be parsed by JQuery as a JSON object holding the values you see, when you open the URL in a browser. This way you have the "shares" variable in your Javascript code you can use for whatsoever you like.
This should give you some keywords you can Google for. Best thing would be to go to www.jquery.com and read some tutorials and look at the AJAX examples. The usage is very straight forward.
One more thing: Please show some research effort in your next question. People are only here to help, but not to do the whole work for you.
精彩评论