JS behavior differs depending on page tree [closed]

I fixed it by including the JS files in the header, so there’s an error in another plugin’s JS that’s causing the issue.