Forum Moderators: goodroi

Message Too Old, No Replies

Topmenu in JS or html

Is JS an option at all

         

dennisjensen

8:00 am on Jan 9, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi guys,

We're launching a new platform/site. I've recently discovered that the new site's topmenu is programmed in Java. I'd anytime say: Oh no, we need that in old school html.

What is your opinion? Google claims to be better at deciphering JS. But... Is that safe? Considering the topmenu as an essential internal link indicator.

Thanks.
Dennis

lucy24

8:03 am on Jan 9, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think your gut feeling is right. Google isn't everything; there are also humans to consider.

For every <script> there should be a <noscript>, except where the <script> is purely optional-extra-added-value-bells-whistles-fluff. Is there a <noscript> version of the menu?

dennisjensen

8:08 am on Jan 9, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi Lucy, thanks.

"Is there a <noscript> version of the menu?" No, not that I've been able to find.

phranque

8:47 am on Jan 9, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



programmed in Java

javascript and java are different languages btw.

can you navigate the site with scripts turned off?
if not, you are requiring lots of extra steps by google between crawling your document and finding your menu links.
maybe they'll get it right.
maybe they won't bother.

dennisjensen

9:41 am on Jan 9, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi Phranque,

Exactly, my concern was, if I could be certain, if Google would get the message at all.
And sorry for confusing JS and Java, I mean JS.

Thanks, guys!

phranque

10:02 am on Jan 9, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have you tried "fetch and render" in GSC?

dennisjensen

10:06 am on Jan 9, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Not yet, site still in the closed sandbox.

NickMNS

1:48 pm on Jan 9, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'll begin by disagreeing, you can use JS provided that all links are added to the pages before completion of the page load ("load" event) and the page loads quickly. Googlebot will "typically" sees these links and be able to crawl them.

Now for the agreeing, in the case of non-critical content I would be happy relying on the "typically" of above, but menu links are critical and even if it would be fine, I would always be worried that maybe, it isn't. So despite what I said I would not "program my menu in JS".

Let me add, the statement:
programmed in Java[Script].

is very vague.
What is the JS used for? Typically JS is added to menus by fancy web-designer to make the pull down menu scroll down smoothly, and to add spiffy hover effects. If this is the case and all the menu links are hard coded in the html then I would not be too worried. But if the JS is used to dynamically populate the menu links, then you need to be concerned.

When Googlebot crawls a page it does not immediately render the JS, it simply collects the data and indexes it. Googlebot will then render the page at some later point if it deems it necessary. This can take weeks or can never occur. Google recommends that if you are providing client side rendered content that you create a second version of the page for Googlebot (and other bots) that is pre-rendered server side.

have you tried "fetch and render" in GSC?

Given the statement above, one cannot rely on Fetch and Render as one can be certain that the "render" portion will occur.

dennisjensen

3:58 pm on Jan 9, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Thanks for the elaborate answer. Especially this: "When Googlebot crawls a page it does not immediately render the JS, it simply collects the data and indexes it. Googlebot will then render the page at some later point if it deems it necessary." Scared the .... out of me.

Thnx to you all.

phranque

1:08 am on Jan 10, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



When Googlebot crawls a page it does not immediately render the JS, it simply collects the data and indexes it. Googlebot will then render the page at some later point if it deems it necessary. This can take weeks or can never occur.

in other words:
you are requiring lots of extra steps by google between crawling your document and finding your menu links.
maybe they'll get it right.
maybe they won't bother.

tangor

7:00 am on Jan 10, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is that JS doing something at HTML and CSS3 can't ... if so, what?

Are you coding for g or the user?

Willing to ignore the 25% of the web with JS off or blocked?

Pick your poison. :)