# Open a URL in page with JavaScript

**URL:** <https://community.folivora.ai/t/open-a-url-in-page-with-javascript/19035>\
**Category:** Configuration Help & General Discussion\
**Created:** [October 2, 2020, 2:09pm UTC](https://community.folivora.ai/t/open-a-url-in-page-with-javascript/19035 "2020-10-02T14:09:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![universvm](https://community.folivora.ai/user_avatar/community.folivora.ai/universvm/32/2411_2.png) [@universvm](https://community.folivora.ai/u/universvm)\
**Post date:** [October 2, 2020, 2:09pm UTC](https://community.folivora.ai/t/open-a-url-in-page-with-javascript/19035/1 "2020-10-02T14:09:29Z")

</div>

Hey there, I currently have a script that opens a url from selection. I would then like to select a PDF document in the page and open it in the same page.

I've produced this code but it doesn't seem to work?

```
let pdf_src = window.document.getElementById('pdf').src
window.open(pdf_src, name="_parent")

returnToBTT(pdf_src);

```

I suspect it is the "window" parameter that JavaScript doesn't know how to search?
