# Detecting hash fragment change

**URL:** <https://forum.wixstudio.com/t/detecting-hash-fragment-change/23594>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [March 31, 2019, 10:35am UTC](https://forum.wixstudio.com/t/detecting-hash-fragment-change/23594 "2019-03-31T10:35:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [March 31, 2019, 10:35am UTC](https://forum.wixstudio.com/t/detecting-hash-fragment-change/23594/1 "2019-03-31T10:35:32Z")

</div>

Is there any way to detect a change in the url hash fragment ?  
Thanks,  
J.D.

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [April 16, 2019, 2:16pm UTC](https://forum.wixstudio.com/t/detecting-hash-fragment-change/23594/2 "2019-04-16T14:16:05Z")

</div>

Found a solution:  
I’ve added a listener to detect hash changes (I put it in the analytics & tracking custom tool, on the dashboard, available for paid accounts only). Then, in order to interact with my page elements, I’ve made it post the hash change to an html component on my page, and using Wix API, I had the html component post it to the Wix code on the page.  
Quite complicated…

---

<div class="post-metadata">

**Author:** ![skmedia](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/skmedia/32/5616_2.png) [@skmedia](https://forum.wixstudio.com/u/skmedia)\
**Post date:** [April 17, 2019, 2:41am UTC](https://forum.wixstudio.com/t/detecting-hash-fragment-change/23594/3 "2019-04-17T02:41:44Z")

</div>

Wouldn’t it be simpler to use query parameters and then if (wixLocation.query.param) ?

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [April 17, 2019, 6:57pm UTC](https://forum.wixstudio.com/t/detecting-hash-fragment-change/23594/4 "2019-04-17T18:57:05Z")

</div>

@skmedia , changing query parameters makes the page reload, so it only fits to specific situations.  
In other cases, you’d like to change the url parameters without reloading the page (page reloading is much less nice from user experience perspective).
