# Embed with JS and iframe not working

**URL:** <https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126>\
**Category:** Developer help\
**Created:** [September 16, 2020, 8:11am UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126 "2020-09-16T08:11:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonwojo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jasonwojo/32/11109_2.png) [@jasonwojo](https://forum.ghost.org/u/jasonwojo)\
**Post date:** [September 16, 2020, 8:11am UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126/1 "2020-09-16T08:11:51Z")

</div>

I’m trying to embed a register to vote form and I’ve tried entering the script both at site wide code injection in the head and page-level. Neither works and I just get a blank.  
Here’s the forms: [https://docs.voteamerica.com/embed/free/](https://docs.voteamerica.com/embed/free/)

```
<script src="https://cdn.voteamerica.com/embed/tools.js" async></script><div class="voteamerica-embed" data-subscriber="public" data-tool="verify"></div>

```

I”m putting the script in the head and the code in the div tag in the body with an html block.  
[https://vote.ghost.io/find-your-polling-place/](https://vote.ghost.io/find-your-polling-place/)

I’ve tried both Casper and the custom theme I was using in order to test, but no luck with any theme.

I had this before where JS didn’t seem to be working on another project.

Any tips? Thank you.

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [September 16, 2020, 8:16am UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126/2 "2020-09-16T08:16:42Z")

</div>

@jasonwojo are you able to share a live page where the script isn’t working?

---

<div class="post-metadata">

**Author:** ![jasonwojo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jasonwojo/32/11109_2.png) [@jasonwojo](https://forum.ghost.org/u/jasonwojo)\
**Post date:** [September 16, 2020, 8:20am UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126/3 "2020-09-16T08:20:33Z")

</div>

[https://vote.ghost.io/find-your-polling-place/](https://vote.ghost.io/find-your-polling-place/)

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [September 16, 2020, 8:45am UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126/4 "2020-09-16T08:45:37Z")

</div>

@jasonwojo the embed is working but it’s styling is resulting in a 1px wide iframe. You could try adding this to the header code injection:

```auto
<style>
.voteamerica-embed iframe {
    width: 100%;
}
</style>

```

---

<div class="post-metadata">

**Author:** ![jasonwojo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jasonwojo/32/11109_2.png) [@jasonwojo](https://forum.ghost.org/u/jasonwojo)\
**Post date:** [September 16, 2020, 9:28am UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126/5 "2020-09-16T09:28:24Z")

</div>

Thank you. I dropped “iframe” and the style worked well.

---

<div class="post-metadata">

**Author:** ![denvergeeks](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/denvergeeks/32/7401_2.png) [@denvergeeks](https://forum.ghost.org/u/denvergeeks)\
**Post date:** [September 16, 2020, 7:35pm UTC](https://forum.ghost.org/t/embed-with-js-and-iframe-not-working/17126/6 "2020-09-16T19:35:59Z")

</div>

Thank you @jasonwojo for promoting voting!!!
