Navigation always loads same page

(Markus Frieauff ) #1

I am experiencing a weird thing: a site that has been running for very long suddenly reacts strangely in Safari 11 (on High Sierra only!). The navigation seems to work, but it doesn’t: when I hover over a menu element I get the correct address shown in the status bar at the bottom of the page. When I click, it remains on the home page. When I right-click and chose “open in new tab” it correctly opens the right link (different page) in a new tab.
All other browsers work. I tested Safari 11 (Sierra) and various other lower versions on browserstack and all seem to work. How can I narrow down the issue? If you want to take a look, here’s the site:

(Dan Smith) #2

Your pages are sending everything within the div pageHeader to your index.html page so you may have Tidy Website links turned on.
You have some user defined javascript on your pages, probably within your settings, code, head tab:

<script type="text/javascript">
    window.onload=function() {
        document.getElementById("pageHeader").style.cursor = "hand";
        document.getElementById("pageHeader").style.cursor = "pointer";
        document.getElementById("pageHeader").onclick = function() {

If you remove the last line the navigation works properly:

document.getElementById("pageHeader").onclick = function() {

Every time someone clicks within your pageHeader<div id="pageHeader">, which includes your navigation bar, they end up going to which ends up, because of tidy website links, being index.html

(Markus Frieauff ) #3

Dan, thanks for that observation. That did the trick. Strange thing is, that code has always been there and I didn’t change a thing. The site always worked. Until the latest version of Safari on High Sierra which couldn’t get it. Nontheless, the mistake was in the code, of course. I modified it to target the title only and now it works as expected. THANK YOU!

(system) #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.