Thursday, September 19, 2024

SEO Corner – JavaScript and Search Engine Visibility

Question: I am using JavaScript on my site, and I am concerned that my site may not being fully seen/indexed by the search engines and the spiders. How can I find out?

Shari’s Answer:

It depends on how you are using JavaScript on your site. Are you using it as a main navigation scheme, such as for HTML (form) drop-down menus? Are you using it for DTHML drop-down menus? Are any of your links to pop-up windows? If so, how many? Or are you simply placing rollovers/mouseovers on your navigation buttons? Many people who create framed sites use JavaScript to keep frames intact at all times.

When you use JavaScript on a site’s navigation scheme, the scripts can greatly decrease the “crawlability” of the links. Currently, most search engines will not follow the links embedded inside of JavaScript code (including rollovers and menus), or they will greatly limit the types of JavaScript-embedded links they will crawl.

Some JavaScript code is more search-engine friendly than others. As a general rule of thumb, the simpler the script is, the more likely a search engine spider will be able to crawl the link.

JavaScript links

Search engine representatives give rather vague answers when asked whether or not they will index links surrounded by JavaScript. One of my colleagues received this answer at a recent search engine conference, “”We reserve the right to index JavaScript.”

Unfortunately, one of the biggest abusers of JavaScript are gambling and adult sites. If you click on a link, multiple windows might open. If you enter a site, a window often pops under the main window. If you try and leave a site, another window opens. Other common abuses of JavaScript include fast redirects and hiding spam techniques.

In all likelihood, spam abuse is the reason why the search engines “reserve the right” to index JavaScript links.

Therefore, my advice to everyone is to always design a site with at least two forms of navigation: one that is 100% search-engine friendly and one that might be less search-engine friendly. If I am designing a site with DHTML menus, I always have a corresponding navigation scheme of text links at the bottom of a page. If that is too many links, then I cross-link pages via contextual links (also known as breadcrumbs) and embedded links in the main content.

I always have a site map link on every page of the site that is never hidden from viewers. Don’t try and hide a site map link in transparent GIF or hidden text. It can get your site in trouble.

The <noscript> tag

In the event that older browsers do not support JavaScript or visitors have disabled JavaScript while surfing the Web, the <noscript> tag provides alternative content for both the search engines and your site visitors. The <noscript> tag, if used, is placed between the <head> and </head> tags.

I usually place a link to a site map page in the <noscript> tag. If one of my clients insists on using a JavaScript-type navigation without an alternative means of navigation the site, I submit the site map page to the search engines instead of the home page.

JavaScript and Spam

Unfortunately, some search-engine-marketers abuse the <noscript> tag. They discovered that they could hide text on a Web page by using the <noscript> tag, even though the actual Web page does not contain any JavaScript.

Never use this tag to hide any unrelated content or links that you would not otherwise show to your site visitors.

Because of the widespread abuse of this tag, most of the search engines either ignore or decrease the relevancy of the text inside of the <noscript> tag. Additionally, most end users will never see the content inside of the <noscript> tag. Search engines tend to ignore all “hidden” tags, or at least not use them determine relevancy.

When I was called on as a search engine expert in a court case a few years ago, I discovered that something as simple as a mouseover and redirect were used to divert traffic from a spam site to the actual site. From a Web site owner’s perspective, the use of JavaScript can benefit the user experience. From the search engine’s perspective, however, the use of JavaScript can be a “red flag” for spam.

Therefore, before adding any type of JavaScript and <noscript> tags to your site, determine whether or not the extra code is necessary. If a JavaScript is written well, the <noscript> tag is unnecessary. Many sites get qualified traffic from the search engines without any JavaScript in the site design.

Shari Thurow is Marketing Director at Grantastic Designs, Inc., a full-service search engine marketing, web and graphic design firm. This article is excerpted from her book, Search Engine Visibility (http://www.searchenginesbook.com) published in January 2003 by New Riders Publishing Co. Shari can be reached at shari@grantasticdesigns.com.

Shari Thurow Answers SEO Questions: Click Here For Free Answers

Related Articles

9 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles