Page 1 of 3

Facebook Share Button without editing source code

Posted: Wed Apr 08, 2015 11:37 am
by Sunita

Hi,

Is there a method to integrate the Facebook share button in my app without having to change the source code?

Many thanks


Facebook Share Button without editing source code

Posted: Wed Apr 08, 2015 3:53 pm
by Egor Kotov6832188

Hello Sunita,

If by "source code" you mean adding JS code and button on the page in editor, then NO.
If changing source files at source tab of your app project, then yes.


Facebook Share Button without editing source code

Posted: Thu Apr 09, 2015 3:24 pm
by Sunita

Hi Egor,

Yes i meant changing source files at source tab of my app project.

Can you please tell me where to add the JS code, basically how to get the facebook share button on a page in my app?

I have read a lot of getsatisfaction, but i could not understand.

Many thanks


Facebook Share Button without editing source code

Posted: Fri Apr 10, 2015 7:38 am
by Evgene Karachevtsev

Hello Sunita,

Please look at these links:
https://developers.facebook.com/docs/...
http://stackoverflow.com/questions/16...
Also please note that custom JS code is outside the scope of our support.


Facebook Share Button without editing source code

Posted: Fri Apr 10, 2015 10:06 am
by Sunita

Hi Evgene,

I have already had a look at those links earlier.

I am just not sure where do I put that code in which is given by facebook?

Many thanks


Facebook Share Button without editing source code

Posted: Sat Apr 11, 2015 8:36 pm
by Illya Stepanov

Hi Sunita -

liCreate JavaScript - and insert this part of code there:
precode(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&quot
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));/code/pre
/li
liPlace an HTML component in your page and define dimensions as 'auto' for width and hight. Click on 'Edit HTML' and insert this lines in 'HTML Source' tab:
precode<div id="fb-root"><>
<div class="fb-share-button" data-href="https:&#47;&#47;developers&#46;facebook&#46;com/docs/plugins/" data-layout="button_count"><>/code/pre
/li

The result should be like this:


Facebook Share Button without editing source code

Posted: Sat Apr 11, 2015 8:46 pm
by Illya Stepanov

Hi Sunita -

ol
li
Create New - JavaScript and insert this part of a code:
precode(function(d, s, id) {
var js, fjs = d&#46;getElementsByTagName(s)[0];
if (d&#46;getElementById(id)) return;
js = d&#46;createElement(s); js&#46;id = id;
js&#46;src = "&#47;&#47;connect&#46;facebook&#46;net/en_US/sdk&#46;js#xfbml=1&version=v2&#46;3&quot
fjs&#46;parentNode&#46;insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));/code/pre
/li
li
Place an HTML component in your page and define dimensions properties as 'auto' for width/height. Click on 'Edit HTML' and place this lines in 'HTML Source' tab:
precode<div id="fb-root"><>
<div class="fb-share-button" data-href="https:&#47;&#47;developers&#46;facebook&#46;com/docs/plugins/" data-layout="button_count"><>/code/pre
/li
/ol

The result should be like this:
Image


Facebook Share Button without editing source code

Posted: Sat Apr 11, 2015 9:09 pm
by Sunita

Hi Illya,

I have done exactly like you have stated.

Here are the screenshots for it:

http://prntscr.com/6sl5y2

http://prntscr.com/6sl66y

http://prntscr.com/6sl6b5

But it does not show up on my page:

http://prntscr.com/6sl6o0

Can you please tell me what is the problem here?

Many thanks


Facebook Share Button without editing source code

Posted: Sun Apr 12, 2015 8:43 pm
by Illya Stepanov

Are there any errors in the browser console? Try inspect this element on the page -- is it existing in the DOM?


Facebook Share Button without editing source code

Posted: Mon Apr 13, 2015 3:32 pm
by Sunita

Hi Illya,

It shows me this error in console:

http://prntscr.com/6t8y4k

What do I need to do?