# JS Error with Popup Form

**URL:** <https://community.hubspot.com/t/js-error-with-popup-form/18224>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [January 20, 2020, 6:19pm UTC](https://community.hubspot.com/t/js-error-with-popup-form/18224 "2020-01-20T18:19:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul5562](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/paul5562/32/31184_2.png) [@paul5562](https://community.hubspot.com/u/paul5562)\
**Post date:** [January 20, 2020, 6:19pm UTC](https://community.hubspot.com/t/js-error-with-popup-form/18224/1 "2020-01-20T18:19:12Z")

</div>

I’m getting a JS error on my popup form on :

[https://www.igneous.io/weekly-demo-dataprotect](https://www.igneous.io/weekly-demo-dataprotect)

The “Watch Now” button should trigger a popup form. The popup works in the preview of the page but not on the page itself. The JS error in the console I’m getting is:

v2.js:4 Uncaught DOMException: Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of this node.  
at HTMLScriptElement.c.onload.c.onreadystatechange ([https://www.igneous.io/\_hcms/forms/v2.js:4:28180](https://www.igneous.io/_hcms/forms/v2.js:4:28180))

I’m hoping someone might have a suggestion on how to fix this error.

Thanks!

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [January 21, 2020, 3:15am UTC](https://community.hubspot.com/t/js-error-with-popup-form/18224/2 "2020-01-21T03:15:10Z")

</div>

Hey @paul5562,

Digging into this, it looks like this is due to this line of javascript code:

`location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname`

This code can be located on your **pages settings** :

1. At the top right hand corner \> Click the ‘_Settings_’ icon

2. At the left side panel \> Expand ‘_Website_’ \> Click ‘_Pages_’

3. Choose domain ‘_[www.igneous.io](http://www.igneous.io)_’

4. Under the ‘_Site footer html_’ \> On **line 61**

While I’m not too familiar with the purpose of this piece of javascript function, if it’s not useful, you may want to remove the whole javascript function from line 59-72 and the pop up form will work just fine.

---

<div class="post-metadata">

**Author:** ![paul5562](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/paul5562/32/31184_2.png) [@paul5562](https://community.hubspot.com/u/paul5562)\
**Post date:** [January 21, 2020, 2:49pm UTC](https://community.hubspot.com/t/js-error-with-popup-form/18224/3 "2020-01-21T14:49:26Z")

</div>

Wendy,

Thank you for pointing this out. That’s some old smooth scrolling js that was left over from the previous site. I removed it and, like you said, the popover forms are working correctly now.

Thank you!
