How to add Facebook like plugin

(Steve Warby) #1

Hi Guys,

I am trying to use this facebook plugin.

On the get code button it states.:

Step 2: Include the JavaScript SDK on your page once, ideally right after the opening tag.

How do I add this in Hype please?


Steve Warby

(Mark Hunte) #2

Put this Javascript in a hype function.

 (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); = id;
  js.src = "//";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk')); 

And load it at scene load.

Then add a rectangle.

And place the HTML code into its innerHTML.

(Steve Warby) #3

Thanks Mark,

got that working.

(Steve Warby) #4

Hi Mark,

I have now moved the rectangle to a second scene. All I see is the facebook link and not the facebook page.

What am I missing here ?


Steve Warby.

(Mark Hunte) #5

I always find this sort of code a PITA

Do you really need to do it this way.

Can you use the iframe version and just put that in each rectangle

(Steve Warby) #6

Hi guys,

the iframe version works thanks ( I didn’t spot the tab).

However I can’t get to to expand to the width of the div or centralise.

(Mark Hunte) #7

The max size you are going to get is 500px as it says on the Facebook site. You can set the width when you configure what you want there.

Your rectangle will have to match it’s size