Sunita
Posts: 0
Joined: Sat Nov 15, 2014 2:40 pm

Facebook Share Button without editing source code

Hi,

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

Many thanks

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Facebook Share Button without editing source code

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.

Sunita
Posts: 0
Joined: Sat Nov 15, 2014 2:40 pm

Facebook Share Button without editing source code

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Facebook Share Button without editing source code

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.

Sunita
Posts: 0
Joined: Sat Nov 15, 2014 2:40 pm

Facebook Share Button without editing source code

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Facebook Share Button without editing source code

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:

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Facebook Share Button without editing source code

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

Sunita
Posts: 0
Joined: Sat Nov 15, 2014 2:40 pm

Facebook Share Button without editing source code

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Facebook Share Button without editing source code

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

Sunita
Posts: 0
Joined: Sat Nov 15, 2014 2:40 pm

Facebook Share Button without editing source code

Hi Illya,

It shows me this error in console:

http://prntscr.com/6t8y4k

What do I need to do?

Return to “Issues”