# Simulator Embed Code

**URL:** https://forum.makecode.com/t/simulator-embed-code/263
**Category:** Arcade
**Created:** [June 17, 2019, 2:25pm UTC](https://forum.makecode.com/t/simulator-embed-code/263 "2019-06-17T14:25:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![garyb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/garyb/32/200_2.png) [@garyb](https://forum.makecode.com/u/garyb)
#### Post date: [June 17, 2019, 2:25pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/1 "2019-06-17T14:25:44Z")

</div>

Have been trying out the embed code using [w3schools.com](http://w3schools.com). Code and editor embed works but the simulator embed just shows loading…

Any suggestions

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [June 17, 2019, 8:53pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/2 "2019-06-17T20:53:24Z")

</div>

It seems to work here: [https://jsfiddle.net/6b82e0ac/](https://jsfiddle.net/6b82e0ac/) . What did you try out?

---

<div class="post-metadata">

### Author: ![garyb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/garyb/32/200_2.png) [@garyb](https://forum.makecode.com/u/garyb)
#### Post date: [June 17, 2019, 10:53pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/3 "2019-06-17T22:53:39Z")

</div>

Yes I tried your embed example on w3schools and it works mine still doesn’t. I then tried my embed code on the jsfiddle site and it still didn’t work. I then recreated it on [maker.makecode.com](http://maker.makecode.com) (it’s not complicated my code ) and the embed code worked. I must be doing something wrong with the blocks at [makecode.adafruit.com](http://makecode.adafruit.com) as I still can’t get the embed code to work.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [June 18, 2019, 5:47am UTC](https://forum.makecode.com/t/simulator-embed-code/263/4 "2019-06-18T05:47:46Z")

</div>

which editor you are using?

---

<div class="post-metadata">

### Author: ![garyb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/garyb/32/200_2.png) [@garyb](https://forum.makecode.com/u/garyb)
#### Post date: [June 18, 2019, 5:58pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/5 "2019-06-18T17:58:58Z")

</div>

I am on a Mac so am using the web interface only at makecode.adafruit and maker.makecode. Then testing the embed. Have tried this with chrome and safari.  
This is your embed code [https://www.w3schools.com/code/tryit.asp?filename=G56U86YZ3TR0](https://www.w3schools.com/code/tryit.asp?filename=G56U86YZ3TR0)

This is mine.  
[https://www.w3schools.com/code/tryit.asp?filename=G56UAHY8C5PT](https://www.w3schools.com/code/tryit.asp?filename=G56UAHY8C5PT)

---

<div class="post-metadata">

### Author: ![garyb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/garyb/32/200_2.png) [@garyb](https://forum.makecode.com/u/garyb)
#### Post date: [June 18, 2019, 5:59pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/6 "2019-06-18T17:59:43Z")

</div>

This is the code block I am looking at.

> **[Button Trial 2](https://makecode.adafruit.com/79215-62329-55311-12948)**
>
> Made with ❤️ in Adafruit Circuit Playground Express - Blocks / Javascript editor.

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [June 18, 2019, 8:23pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/7 "2019-06-18T20:23:53Z")

</div>

In Edge Dev (Chromium-based), I’m getting a JS error on line 128:

`Uncaught TypeError: Cannot read property 'getAttribute' of null`

```javascript
128 var code = window.frameElement.getAttribute('data-code')

```

---

<div class="post-metadata">

### Author: ![ChaseMor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chasemor/32/18_2.png) [@ChaseMor](https://forum.makecode.com/u/ChaseMor)
#### Post date: [June 18, 2019, 8:44pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/8 "2019-06-18T20:44:19Z")

</div>

This is a known bug tracked [here](https://github.com/microsoft/pxt-microbit/issues/2152)

There is already a fix in place for it on microbit, maker, and arcade, but the bug will persist in adafruit until the newest version of pxt is updated on that editor.

---

<div class="post-metadata">

### Author: ![garyb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/garyb/32/200_2.png) [@garyb](https://forum.makecode.com/u/garyb)
#### Post date: [June 18, 2019, 9:22pm UTC](https://forum.makecode.com/t/simulator-embed-code/263/9 "2019-06-18T21:22:28Z")

</div>

Thanks a lot!!
