# Getting document.URL

**URL:** <https://talk.observablehq.com/t/getting-document-url/2110>\
**Category:** Help\
**Created:** [July 2, 2019, 1:14pm UTC](https://talk.observablehq.com/t/getting-document-url/2110 "2019-07-02T13:14:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [July 2, 2019, 4:45pm UTC](https://talk.observablehq.com/t/getting-document-url/2110/3 "2019-07-02T16:45:33Z")

</div>

This should work:

```auto
Object.assign(document.createElement("a"), {href: ""}).hash

```

Edit: actually it won’t because we don’t pass the hash down to the worker. So, you’ll need to use the query string, at least for now.

---

_[View the full topic](https://talk.observablehq.com/t/getting-document-url/2110)._
