SEO glossary · J

JavaScript

What is JavaScript?

JavaScript is the programming language of the web. It runs in the browser and makes pages interactive: menus, forms that check your input, sliders, maps, calculators and content that updates without reloading the page. With HTML (structure) and CSS (design), it is one of the three core web technologies.

What JavaScript is used for

  • Interactive elements and animations
  • Web apps built with frameworks such as React, Vue, Angular and Svelte
  • Analytics, advertising and tracking codes
  • Server-side code, with Node.js

JavaScript and SEO

Google can run JavaScript and index the content it creates, but that happens in a separate rendering step that can be delayed, and other search engines and AI crawlers may not run JavaScript at all. To be safe:

  • Put important content and links in the HTML the server sends, using server-side rendering or static generation where possible.
  • Use real links (<a href>) rather than click handlers for navigation.
  • Don’t block JavaScript files in robots.txt.
  • Check pages with the URL Inspection tool in Google Search Console.

JavaScript and speed

Heavy JavaScript slows pages down and hurts Interaction to Next Paint. Remove unused scripts, and load third-party tags with care.

JavaScript and SEO example

An online shop builds its product listing so that products load with JavaScript after the page opens. When Google fetches the page, the first HTML contains no product links. Google can render the page later, but new products are found slowly and other crawlers see an empty page. The shop switches to server-side rendering, so the product links are in the first HTML response, and indexing speeds up.

JavaScript SEO checklist

  1. Put the main content, headings and links in the HTML the server sends, or use server-side or static rendering.
  2. Use real links (an a tag with an href) for navigation, not click handlers.
  3. Do not block your JavaScript and CSS files in robots.txt.
  4. Give each view its own URL, not only a hash fragment.
  5. Test with the URL Inspection tool in Search Console to see the rendered page.
  6. Keep scripts small and load non-essential ones later.

JavaScript mistakes

  • Hiding important text behind a click that needs JavaScript to load it.
  • Loading too many third-party scripts, which slows the page.
  • Assuming every crawler, including AI crawlers, can run scripts.
  • Putting the page title and canonical tag in scripts only.

JavaScript FAQs

Can Google index JavaScript sites?

Yes, but it is slower and riskier than plain HTML. See HTML, CSS and page speed.

What is a framework?

A set of tools for building web apps, such as React or Vue. Many can render on the server. See crawlers.

Get in touch

Know the term. Now rank for it.

Tell us the search you want to win. A specialist reads it and replies by email, and if it helps, we set up a short call.

    A specialist reads your message and replies by email.