开发者

Display share buttons with Ajax. Where to put facebook and twitter scripts?

This is a simple php file that displays a Like and Tweet button.

<? $url = "http://example.com"; $title = "Title";?>

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=247886858583094&amp;xfbml=1"></script><fb:like href="<?=$url?>" send="false" layout="button_count" width="80" show_faces="true" font=""></fb:like>

<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?=$url?>" data-text="<?=$title?>" data-count="horizontal" data-via="lisovaccaro" data-lang="es">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

My problem is basically that I want t开发者_StackOverflowo get this file to display in my page via Ajax and it doesn't. It works as a standalone page, just doens't load through ajax.

Why doesn't it work and what can I do to make it work?


Facebook :

http://forum.developers.facebook.net/viewtopic.php?id=68635

Twitter :

http://www.ovaistariq.net/447/how-to-dynamically-create-twitters-tweet-button-and-facebooks-like-button/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜