# Embed playbuzz quiz into post

**URL:** https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183
**Category:** Support
**Created:** [March 15, 2017, 3:37pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183 "2017-03-15T15:37:58Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![wm00](https://avatars.discourse-cdn.com/v4/letter/w/839c29/32.png) [@wm00](https://meta.discourse.org/u/wm00)
#### Post date: [March 15, 2017, 3:37pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/1 "2017-03-15T15:37:58Z")

</div>

I want to add a quiz from [playbuzz.com](http://playbuzz.com) into a post using the javascript they offer. Is that possible? Just copy/past the code do not seams to work…

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [March 15, 2017, 3:58pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/2 "2017-03-15T15:58:01Z")

</div>

> [@wm00](#):
>
> Is that possible?

Goodness no. Allowing JavaScript (which BTW is _not_ Java) would be a _major_ security vulnerability.

Imagine something like a “all your cookie are belong to us” script 😱

---

<div class="post-metadata">

### Author: ![wm00](https://avatars.discourse-cdn.com/v4/letter/w/839c29/32.png) [@wm00](https://meta.discourse.org/u/wm00)
#### Post date: [March 15, 2017, 4:53pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/3 "2017-03-15T16:53:47Z")

</div>

But it could be allowed just for admins and moderators. I see [playbuzz.com](http://playbuzz.com) quizzes everywhere including facebook and large sites. How can they allow to add them is it is such a big security issue…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 15, 2017, 9:44pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/4 "2017-03-15T21:44:10Z")

</div>

Probably not. Here’s what [playbuzz.com](http://playbuzz.com) wants you to be able to do when you paste their URL somewhere:

[http://www.playbuzz.com/Thechive/do-you-know-what-being-healthy-was-like-100-years-ago](http://www.playbuzz.com/Thechive/do-you-know-what-being-healthy-was-like-100-years-ago)

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [March 16, 2017, 3:11am UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/5 "2017-03-16T03:11:14Z")

</div>

I wonder what the deal is with codepens that have JavaScript?

> [@Jsfiddle-like embeds?](https://meta.discourse.org/t/jsfiddle-like-embeds/59215/2):
>
> You can use CodePen: [http://codepen.io/Yakudoo/pen/YXxmYR](http://codepen.io/Yakudoo/pen/YXxmYR) Also sketchfab for viewving 3D models:

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 16, 2017, 3:13am UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/6 "2017-03-16T03:13:31Z")

</div>

> [@Mittineague](#):
>
> I wonder what the deal is with code pens that have JavaScript?

Codepen is a good netizen and only executes random JS when you click on the play button.

> [@Embedding pens from CodePen](https://meta.discourse.org/t/embedding-pens-from-codepen/13578/31):
>
> Hey Team! We’ve worked on a fix for this: click-to-play, as you suggested. We haven’t deployed it yet, but it would be how all oEmbed embedded Pens would behave. When the embed loads, you get a (very lightweight) placeholder with the title of the Pen and author and such. Plus a big “Run Pen” button. If anywhere on there is clicked/tapped, it loads the embed. Thus, no unexpected sound, no unexpected crazy CPU use, no going to a page with a zillion embeds and feeling the lag, etc.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [March 16, 2017, 6:43pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/7 "2017-03-16T18:43:01Z")

</div>

The playbuzz embed code has two parts - a `script` tag and a `div` tag. You can get it to load in Discourse by adding a site customization that appends the `script` tag to your forum’s `head` and then adds the `div` markup to the post that you want the quiz to appear in. This works, but it causes an error: `Cannot read property 'offsetTop' of undefined`. I’m guessing that’s related to Discourse infinite scrolling.

From looking at the Playbuzz forum - it’s a Discourse forum - probably the best way to do it would be to embed the quiz on a WordPress site with their WordPress plugin, and then embed an iframe on Discourse that has the WordPress page as it’s `src`. This works, but to get it setup correctly takes quite a lot of work.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 15, 2019, 2:39am UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/8 "2019-05-15T02:39:19Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 22, 2022, 9:21pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/9 "2022-09-22T21:21:15Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 25, 2022, 8:54pm UTC](https://meta.discourse.org/t/embed-playbuzz-quiz-into-post/59183/10 "2022-10-25T20:54:10Z")

</div>


