Forum Moderators: Robert Charlton & goodroi
I could rewrite the navigation in JavaScript
Or would making the navigation all JavaScript inadvertently make the search engine stop following the links?
I should mention that the navigation is repeated in the page footer without JavaScript.
<nav> ... </nav> tags, that is what they are for.
Would you mind elaborating a little bit on this?
The primary purpose of your menu is to allow your visitors to find what they are looking for easily, and your site needs to remain navigable if css or JS are not working in the visitor's browser, and for small-screen devices.
<nav> ... </nav>
it is likely that Googlebot is a 'headless browser' that understands the page in its final rendered state and not as a collection of code from different files
About 2 months ago I changed my top menu from listing 14 main categories to a mega menu with around 400 main and sub categories. Of course this added a mass of code to the site (straight placement code not re-positioned with css). The result? Not the slighest change in ranking or traffic after 2 months despite the extra links and coding.
I still have a big aversion to mega-menus, though, or even just large drop-downs. I describe them as "confusing for users, confusing for Google."
Google is saying that hidden content on the page is ignored.
if (screen.width < 480)
document.getElementById('something').style.display = 'none';
else
document.getElementById('something_else').style.display = 'none';
If they do read the conditionals, which one would they see?
What if I do something like thisdocument.getElementById('something').style.display = 'none';
But why would you need to take this additional script-dependent step when you can do the same thing directly in the CSS?