Skip to content
Advertisement

Navigating around website adds a [object object] to URL after clicking around anchors

Thanks for reading. I just wanted to know why i get a “/index.html#[object Object]” at the end of URL when clicking around anchors on a single page website.

I would also like to know if i can remove it if it isn’t too game changing with htaccess or resolve the issue that is occuring?

If you require more information that isn’t in this help request feel free to ask 🙂 !

The website the-md.studio

Advertisement

Answer

On your custom.js file, this line (~147):

enter image description here

window.location.hash = target;

target is not the selector, is a jquery element, so it’s an object.

Change it for this one:

window.location.hash = target.selector;

I think that’s what you want

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement