Adding a bookmark link to a Facebook IFRAME app
I have a simple IFRAME based facebook app, with everything set up for XFBML (it's working by the way), and I want a link to add a Facebook bookmark. It sounds simple but it really doesn't seem to be.
doesn't show anything, even though other tags render, so I was looking at doing it with a link instead, the way the Facebook developer app does at the top.
If I user a link to
"http://www.facebook.com/fbml/ajax/uiserver.php?method=bookmark.add&app_id=XXX&display=async"
Then I can open the bookmark form in a full window, but w开发者_如何学Pythonhat I really want is to do it in an ajax pop-up, the way Facebook and the developer app do. However when I call the same url with $.get from Jquery it displays nothing.
Any ideas? What's the right way to do this?
All you should have to do is use <fb:bookmark></fb:bookmark>
. More information here:
http://developers.facebook.com/docs/guides/canvas/#bookmarks
Under "bookmarks and counters". Or is that maybe what you had above, but the tag got stripped out of your question?
Turns out that this is a known Facebook bug that was first reported in April:
http://bugs.developers.facebook.net/show_bug.cgi?id=11423
They haven't gotten to it yet, and it's currently assigned their lowest priority, but I'm sure some more votes on the issue wouldn't hurt.
In the meantime, I haven't tested this but a workaround appears to be showing an image of the bookmark and doing the dialog JavaScript yourself (from www.devcomments.com/trouble-with-fb-bookmark-to182399.htm):
<img src="bookmark.png" onclick="FB.Connect.showBookmarkDialog()" style="cursor:pointer;" />
精彩评论