Refresh Fb Comments Plugin - facebook

I'm trying to add a link to allow a user to refresh the Comments plugin on my page so they can see other posts by other people.
I want to do it without refreshing the full page.
There's a html5 player on the page playing audio, hence me not wanting to interrupt that player.
Currently I'm using the standard -
I've tried the jQuery method of giving the div an id and having a header script which counts to 10 and reloads the div widget, it seems to reload the widget, but it doesn't update the contents of the comments plugin to show other's posts, just ones you've added yourself. To see all the updates you have to refresh the page fully, which I don't want to do.
I'm trying to avoid iFrames because of the height issues and extra scroll bars, etc.
Any ideas would be appreciated

I'm not exactly sure what you're trying to do, but you can use the FB.XFBML.parse method to refresh plugins.
The only thing is that you'll need to first remove the old plugin from the dom, then add the new html5/xfbml placeholders (what you get from the comments plugin page when clicking "get code") and then use the FB.XFBML.parse method.

Related

Fancybox 2: Any way of opening iframe without showing it?

I am using Fancybox 2 for my web application. I read its online documenation, but failed to find a way of opening iframe without showing it to a user.
The reason for my inquiry is that when a regular page is loaded, I would like to make a Fancybox iframe get loaded too without a user's notice. When the user clicks on a link on the page that will trigger Fancybox to show the iframe, I would like to make it simply visible. I hope this would greatly improve user experience in terms of speed.
Any ideas or links would be really appreciated.
You could, for example, simply create hidden iframe element and display it as any other "inline" element using fancyBox.

Want to share a particular block or div from my entire page into facebook

I have a requirement that in a webpage I have multiple block of content which is wrapped inside individual DIV. Each block needs to have a share to facebook button.
Did many researches but couldn't find a solution. Please can anyone give me a suitable code or idea how I can share particular blocks/content wrapped inside a div into facebook.
For e.g.
I have three DIV in my page and each DIV has share button, when user clicks on any of the share button the respective DIV is shared.
Is there any solution to this requirement or whether is it possible to do. Any kind of suggestions are widely accepted.
Check out this HyperArts tutorial on adding a Share Button to an iFrame tab - you use the exact same code for your webpage. You will be using the Facebook JavaScript SDK.
At the end of the tutorial it explains how to modify it to allow for multiple Share buttons on one page. You just need to add a unique identifier for each one.

<fb:comment> tag not working properly

I have a GWT app and Im trying to put fb social plugin comment in side of my page. However I have the folowing problem.
If I put the tag in my .html it works perfect, but If I put id dynamically (like with an HTML widjet), It does not work. It just does not display anything.
Can anyone help me? Im having this problem in general, not only with the fb:comment tag.
Note: If I use the iframe implementation of, for example, "fb:like", it works perfect.
My understanding of facebook's api is that it loads your content, and parses out the tags in the fb namespace, replacing them before the actual content is drawn for the user. In contrast, none of the GWT compiled code (or indeed any Javascript code) gets a chance to make changes to the dom until the page has loaded in the browser fully, after facebook has made the changes it needs to.
My advice: Put the fb namespaced tags on the initial page, but perhaps wrap them in a div and mark them as display:none. Then you can grab them from your GWT code and wrap them up in a widget, only to be displayed when you are ready.

FB.provide is not a function

I'm developing a WordPress plugin to show above or bottom the posts Facebook like and send buttons.
Unfortunately when is also activated a plugin for Facebook share button there is a Javascript error (FB.provide is not a function) and like and send buttons don't appear.
For example this happens in this page: http://www.pasqualepuzio.it/2011/04/plugin-facebook-like-and-send-button/
How can I solve this issue?
Thank you very much
I ´ve faced the same problem and it happens if you add the script twice on the site (http://connect.facebook.net/sv_SE/all.js)
I understood that part that we cant have all.js twice but I want to have Facebook Share Button and Facebook Like Button.
According to Docs, I need to include these two JS Files.
https://connect.facebook.net/en_US/all.js
http://static.ak.fbcdn.net/connect.php/js/FB.Share
Now, If I include both Firebug will give me same error "FB.provide is not a function". If I remove either of them then Like or Share button wont work.
I can do iFrame version but I have HTML Encoding issues with iFrame Version. I am programmatic generating HTML Response.
Any idea, how to approach?
There is a workaround for this: instead of placing the javascript Fb.Share within the same page where you are loading the Javascript SDK, use an Iframe with the first and set it in the second.

Updating URL without refresh

I am iterating through data and generating parameterized URL's for links (to the same page, but with parameters) on a dashboard app. However, the way I'm doing it requires a page refresh when the user clicks the link.
Generating URL with a StringBuilder
Detailhtml.append("<a href=\"http://" + domain + "&service=" + count +"&day=" + day +"\"><img src=\"/info.jpg\" alt=\"Info\"/>");
Is there a way I can dynamically create GWT buttons, or trigger some javascript to add the parameters without a page refresh?
Any help would be great...
The page will refresh if any part of the URL before the fragment (#) changes. So if you go form foo.com#a to foo.com/?bar=baz#a, a page refresh will be triggered.
The best way to get around this is just to never change anything before the fragment. Change foo.com/?bar=baz to foo.com/#bar=baz (or some variant) and have your GWT app listen for History changes by calling History.addHistoryListener(...).
Then, when you hear a history change, parse the fragment in the URL and update your app accordingly.
Some libraries like gwt-platform provide a wrapper around this functionality and let you describe Places which will get triggered when the fragment updates to match them. If you end up doing a lot of complicated things with the fragment, it would be a good idea to look into places. But if you're just passing a few parameters around, you can get away with just listening for History changes.