JavaScript has become one of the more complex topics in SEO, with the understanding of how it affects search performance seemingly varying between SEOs.

However, understanding JavaScript and how search engines handle it has never been more important with more websites and webpages relying on it for crucial content elements and internal linking.

Understanding JavaScript basics is a good start, but being able to understand and more confidently predict how search engines will receive webpages with high levels of JavaScript usage can be the difference between successful site migrations and launches, to flops.

From this point, new terminology to the SEO vocabulary is introduced, such as ECMAScript, transpiling, and understanding the Document Object Model (DOM).

So how do search engines handle JavaScript? Can they index content served by JavaScript?

These are common questions, and despite Google’s best efforts in explaining how the crawl & WRS process works, there is still a lot of confusion out there. There is even more confusion outside of Google, where information is not as forthcoming from webmaster analysts or search liaisons.

For research, we looked to answer these questions, and more, in February 2020, we ran an experiment to see if five major search engines could index JavaScript content:

  • Injected before the DOM has loaded
  • Injected after the DOM has loaded
  • Through asynchronous injection
  • Injected after the HttpRequest

Tested in five search engines, these being Googe, Bing, Yandex, Baidu, and Naver.

Google & JavaScript

As expected, Google performed best throughout the research and seemed capable of indexing dynamic content.

UA Injected before the DOM has loaded Injected after the DOM has loaded Through asynchronous injection Injected after the HttpRequest
Google Yes Yes Yes Yes

As side tests, Google also appeared capable of indexing changes that had been implemented through tools such as ODN and Sloth. However, content hidden behind tabs and other on-page elements that required an onClick event to reveal (despite them having their own URI paths) were not being indexed.

Bing & JavaScript

From our research, Bing wasn’t able to detect any dynamic content modifications.

As we poked and played around with data, our research began to show evidence that Bing was processing and indexing some JavaScript content, but not in any reliable fashion.

UA Injected before the DOM has loaded Injected after the DOM has loaded Through asynchronous injection Injected after the HttpRequest
Bing No No No No

Bing also did not seem capable of indexing or acknowledging meta, such as Hreflang, being injected via the edge layers.
Data suggests that Bing has a two-phase indexing process, much like Google.

However, we know with Google that it generally uses the rendered HTML version of a webpage for indexing purposes. In contrast, Bing’s approach seems to vary between using content from the initial HTML response and the rendered HTML – leading to the unreliability as mentioned earlier.

Yandex & JavaScript

For the most part, Yandex appears as capable as Google in indexing JavaScript dynamic content, only not picking up our experiment content when content had been asynchronously injected into a <div> element.

UA Injected before the DOM has loaded Injected after the DOM has loaded Through asynchronous injection Injected after the HttpRequest
Yandex Yes Yes No Yes

It’s also worth mentioning that Yandex’s guidelines on JavaScript are to utilise SSR (server-side rendering).

Baidu & JavaScript

Our research correlates with our real-world experiences of working on Baidu SEO campaigns that the Chinese search engine is not capable of rendering any content served with JS.

UA Injected before the DOM has loaded Injected after the DOM has loaded Through asynchronous injection Injected after the HttpRequest
Baidu No No No No

Naver & JavaScript

If you are relying on Naver to render JavaScript to view your content, it is virtually JavaScript blind.

Our research correlates with what we have seen working with SaaS companies trying to enter the South Korean market, with certain areas of their websites being built on platforms such as Angular (and not SSR) not returning content within the search engine.

UA Injected before the DOM has loaded Injected after the DOM has loaded Through asynchronous injection Injected after the HttpRequest
Naver No No No No