# Embeding a notebook as an iframe

**URL:** https://talk.observablehq.com/t/embeding-a-notebook-as-an-iframe/2560
**Category:** Help
**Created:** [November 17, 2019, 8:35pm UTC](https://talk.observablehq.com/t/embeding-a-notebook-as-an-iframe/2560 "2019-11-17T20:35:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![maliky](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/maliky/32/706_2.png) [@maliky](https://talk.observablehq.com/u/maliky)
#### Post date: [November 17, 2019, 8:35pm UTC](https://talk.observablehq.com/t/embeding-a-notebook-as-an-iframe/2560/1 "2019-11-17T20:35:24Z")

</div>

How can I make the example of [https://observablehq.com/@mbostock/embedded-notebook](https://observablehq.com/@mbostock/embedded-notebook) work for my charts ?

Changing the linked chart from one of Mike’s to one of mine as done [here](https://observablehq.com/d/803324ee40b7e30d) raise the following CORS issue.

```auto
Access to script at 'https://api.observablehq.com/@maliky/simple-line-chart-to-embed-in-resizable-react-components.tgz?v=3' from origin 'https://maliky.static.observableusercontent.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

```

Thank you

---

<div class="post-metadata">

### Author: ![bgchen](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgchen/32/784_2.png) [@bgchen](https://talk.observablehq.com/u/bgchen)
#### Post date: [November 17, 2019, 8:52pm UTC](https://talk.observablehq.com/t/embeding-a-notebook-as-an-iframe/2560/2 "2019-11-17T20:52:36Z")

</div>

Change the `.tgz` in this line:

```auto
import define from "https://api.observablehq.com/@maliky/simple-line-chart-to-embed-in-resizable-react-components.tgz?v=3";

```

to `js`:

```auto
import define from "https://api.observablehq.com/@maliky/simple-line-chart-to-embed-in-resizable-react-components.js?v=3";

```

---

<div class="post-metadata">

### Author: ![maliky](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/maliky/32/706_2.png) [@maliky](https://talk.observablehq.com/u/maliky)
#### Post date: [November 17, 2019, 8:56pm UTC](https://talk.observablehq.com/t/embeding-a-notebook-as-an-iframe/2560/3 "2019-11-17T20:56:25Z")

</div>

Ho ! You’re observable fu is strong :). Thank you very much. I hope I’ll remember that for next time.

---

<div class="post-metadata">

### Author: ![maliky](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/maliky/32/706_2.png) [@maliky](https://talk.observablehq.com/u/maliky)
#### Post date: [November 18, 2019, 8:40pm UTC](https://talk.observablehq.com/t/embeding-a-notebook-as-an-iframe/2560/4 "2019-11-18T20:40:07Z")

</div>

Do you know why the iframe does not fill the vertical space when height is set to 100% but it does so for the horizontal space when width is set to 100% ?

How can I make that iframe fill a div that is changing shape with (or without) the `preserveAspectRatio` of view port ?
