I want to use the sharebook plugin for the web application I'm working on, I only need the primary access button. The application uses requirejs to download javascript, so I followed the manual and changed the facebook api url to the one that was found in the code snippets on facebook docs . This does not work, and sdk throws an invalid version specified error. This is what my files look like.
main.js
require.config({ shim: { 'facebookshare' : { exports: 'FB' } }, paths: { 'facebookshare': "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0" } }); require(['fb']);
fb.js
define(['facebookshare'], function(facebook) { document.body.innerHTML += '<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button"></div>'; });
What is the best way to enable only sharebook plugin for facebook with requirejs?
I referred to the following questions, but none of them gives a concrete solution. Uninstall error: no version specified and invalid version error .
javascript facebook requirejs facebook-javascript-sdk
Ajinkya Dec 23 '14 at 13:16 2014-12-23 13:16
source share