Web CEO logo

Search engines and your fancy menu:
will they escape?

Websites should be created for people, not for search engines. Everyone is aware of this, but no matter how user-friendly and delightful to your visitors’ eyes your website may be, people will not appreciate it until they find your site via a search engine. No webmaster should be surprised by the fact that beautiful design elements often must be sacrificed to acquire better search engine visibility (for example, sleek flash movies or JavaScript menus that aren’t indexed so well as HTML documents by search engines).

The old question of priorities for practically all webmasters remains unanswered. The sporadic discussions on various webmaster and SEO forums do not give a definite answer, at least we found no sound piece of advice based on someone’s systematic tests. We began to wonder and this brought us to the idea of putting an end to speculations and describe the current situation as it is.

Serge Bondar, a Web CEO analyst, ran a series of experiments to discover how the major search engines handle texts in JavaScript and if the search engines follow URLs and index texts in JavaScript menus.

Embedded JavaScript tests

A test web page http://www.hitlens.com/textinscript.html has been created to check whether texts inside the JavaScript pieces are indexed by Google, Yahoo, and Live (MSN). Three cases of different keyword placement in the text have been studied.

Test 1.

Input: Two unique keywords (phlabievle, wlagiugieh) are used in the visible text of the web page, one unique keyword (sluwlucrie) is used inside the JavaScript (within <script>…</script>).

Result: On all the three major search engines the test page is found for the keywords phlabievle, wlagiugieh (placed within the Body tag) but it is not found for the keyword sluwlucrie located inside the JavaScript (within <script>…</script>).

Test 2.

Input: Two unique keywords (yietieblub, jiubrlaphl) are used in the visible text of the web page, one unique keyword (bluwougout) is in the JavaScript comment.

<script><!—
//bluwougout
--></script>

Result: None of the three major search engines finds the page for the keyword bluwougout in the JavaScript comment.

Test 3.

Input: Two keywords (spieswousl, brluvoaxie) are used in the visible text of the web page, one unique keyword (xiexoazlab) is generated by a JavaScript (<script>document.write('xiexo' + 'azlab');</script>).

Result: The page is not found for the generated keyword ‘xiexoazlab’.

The table below shows Google, Yahoo, and Live (MSN) robots behavior: X = the keyword was not indexed, O = bots indexed the word.

Condition

Google

Yahoo

MSN (Live)

A unique keyword within the JavaScript

X X X

A unique keyword in the JavaScript comment

X X X

A unique keyword generated by the JavaScript

X X X

Conclusion to tests 1, 2, and 3: none of the three major search engines can index keywords within the JavaScript pieces.

The next important point of the experiment was to study robots’ behavior to see if the SE robots can find text and URLs in JavaScript menus. For this test, http://www.hitlens.com/scriptinmenu.html has been created. The JavaScript menus are provided there in two variations: 1) with the embedded JavaScript and 2) with the JavaScript referenced as an external '.js' file.

Embedded JavaScript menu tests

For the menus called from the embedded JavaScript, the following tests have been completed.

Test 4.

Input: Unique keywords (hiaspiuniu, houflunieq) are inside the JavaScript menu.

Result: The test web page is found for both of these words.

Test 5.

Input: The JavaScript calls the unique keywords (wriaplekle, croapoapho) on the onMouseOver command.

Result: Neither of the three major search engines finds the page on these keywords.

Test 6.

Input: Pages http://www.hitlens.com/seoresearch/linkinmenu01.htm and http://www.hitlens.com/seoresearch/linkinmenu02.htm could be indexed only if robots would follow the links in the JavaScript menu.

Result: Google and Windows Live (MSN) indexed these pages (on keywords: wiajlaflun, houcrlucle, ziazlamoek and troedluyiu, gluthlewiu, moadroedia) and only Yahoo did not follow the links.

The table below gives the information on how Google, Yahoo, and Live (MSN) robots indexed keywords in the JavaScript menus and on pages found through links in the JavaScript menus: X = the keyword was not indexed, O = bots indexed the word.

Condition

Google

Yahoo

MSN (Live)

Unique keywords in a JavaScript menu

O

O

O

Unique keywords appear onMouseOver JavaScript menu

X

X

X

Keywords on pages followed to through links in JavaScript menus

O

X

O

The picture is a little different if a JavaScript menu is contained in an external JavaScript file.

External JavaScript menu tests

Test 7.

Input: The unique keywords (troestiebo, rluwriazla, riestoudro) were placed in the JavaScript menu.

Result: The test web page is not found for these words by any of the major search engines.

Test 8.

Test pages http://www.hitlens.com/seoresearch/linkinmenu03.htm, http://www.hitlens.com/seoresearch/linkinmenu04.htm and http://www.hitlens.com/seoresearch/linkinmenu05.htm can be only indexed if a search engine robot follows links in the JavaScript menus located in the external file.

Result: Hands down, GoogleBot wins the race! It is the only crawler that indexed the mentioned web pages (keywords: stlevoubou, kleswlabri, nlecluwoek; piekoawlus, drlaziathl, ziazoatouq and stouciesti, klutoadoaf, driacrlast).

The table below shows Google, Yahoo, and Live (MSN) robots: X = the keyword was not indexed, O = bots indexed the word.

Condition

Google

Yahoo

MSN (Live)

Unique keywords appear onMouseOver JavaScript menu

X

X

X

Keywords on pages followed to through links in JavaScript menus

O

X

X

The tests prove that the three major search engines handle JavaScripts differently. In some cases (tests 4 and 6) JavaScripts are not obstacles to search engines’ indexing. In other cases, no page indexing takes place as proved by tests 1-3 when a keyword is contained in the JavaScript or is generated by the JavaScript, or test 5 when the search engines are expected to read keywords appearing on mouseover commands.

We hope the results of this research will be interesting to SE analysts, strategists and webmasters. We promise to continue our investigations on SEs behavior with more tests and bring you some new valuable results.

Copyright © 2001-2007 Web CEO LTD