Javascript and Search Engine Optimization

Search engine spiders cannot read javascript. If you have a dynamic content such as a dynamic menu that uses javascript the search engine spiders will not find and follow the links in that menu therefore, the spider will not be able to index the rest of the pages on your site.

This article is part six of our series of SEO (Search Engine Optimization) related articles - Web Page Content Search Engines See.

What is Javascript?

Javascript is a scripting language web authors use to create interactive websites. Javascript can interact with HTML coding to create dynamic content such as dynamic navigation menus.

Javascript Dynamic Menus

In this article we are going to focus on javascript dynamic menus.

A javascript dynamic menu is a navigation menu that changes depending on where the user has their mouse placed.

Example of a javascript dynamic menu

The Normal state is what the menu looks like when the page is loaded.

Mouseover state is as the name implies, how the menu looks when the user's mouse is over the menu item. Javascript is used to change the image on the left of the menu above.

If the javascript dynamic menu has sub menu items it would look something like the mouseover with expanded menu image above.

How Search Engines See Javascript Dynamic Menus

If we use a Lynx viewer to test how a javascript dynamic menu will look to the search engines we will get:

Example lynix view of dynamic menu

That's it. Nothing. The test page had no web content, we just tested the javascript dynamic menu.

If you check the Google Information for Webmasters you will see that Google suggests using this technique to examine your web page content to see how the search engine will see the page content.

...Use a text browser such as Lynx to examine your site, because most search engine spiders see your site much as Lynx would. If fancy features such as JavaScript, cookies, session IDs, frames, DHTML, or Flash keep you from seeing all of your site in a text browser, then search engine spiders may have trouble crawling your site...

Source:  Google Webmaster Help Center - Webmaster Guidelines - Technical Guidelines

As you can see from the demonstration above the search engines are not going to see this type of javascript dynamic menu. If the search engines can't see the links in the navigation system of the website, they are not going to find the rest of the pages on the website.

Javascript dynamic menus can be built that the search engines can see. For search engine optimization purposes if you wish to have a javascript dynamic menu you will have to find one that creates links that the search engines can see.

In summary, search engines cannot index scripts. If a script type menu system is used on a website it has to be written in a fashion that the search engines can see and index the links it contains.

Javascript and Google

Google has stated they are getting better over time at reading and executing Javascript.

On Apr 25, 2012 Google released a video on their GoogleWebmasterHelp YouTube channel explaining this further: How effective is Google now at handling content supplied via Ajax?.

Keep in mind that this if for Google, not all search engines and their search bots.

Search Engine Optimization Articles

Back to Web Page Content Search Engines See

If you found this web page a useful resource for your own website please link as follows:

HTML Basic Tutor - www.htmlbasictutor.ca/

For search engine optimization javascript dynamic menus have to be written in a fashion that search engines can see and index the links it contains.
URL: