Search Engines and JavaScript

Site designers using JavaScript are concerned their sites may not be fully seen or indexed by search engines and spiders.

Are you using JavaScript as a main navigation scheme, such as for HTML (form) drop-down menus? Are you using it for DHTML drop-down menus? Are any of your links to pop-up windows? If so, how many? Or, do you simply place 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 won’t follow the links embedded inside JavaScript code (including mouseovers and menus), or they greatly limit the types of JavaScript-embedded links they’ll 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 can crawl the link.

JavaScript Links

Search engine representatives give rather vague answers when asked whether they 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.” Basically, when you deal with JavaScript and the search engines, it’s hit-or-miss.

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

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

My advice is to always design a site with at least two forms of navigation: one that’s 100 percent search engine friendly and one that may be less search engine friendly. If I design a site with DHTML menus, I always have a corresponding navigation scheme of text links at the bottom of a page. If that’s too many links, 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. It’s never hidden from viewers. Don’t try to hide a site map link in a transparent GIF or hidden text. It can get your site in trouble.

The Tag

In the event older browsers don’t support JavaScript or users have disabled it, the tag provides alternative content for both the search engines and your visitors. The tag, if used, is placed between the and tags, though some designers place it between the and tags.

I usually place a link to the site map page in the tag. If a client insists on using a JavaScript-type navigation without alternative navigation, I submit the site map page to the search engines instead of the home page.

JavaScript and Spam

Some search engine marketers abuse the tag. They can hide text on a Web page by using it, although the Web page doesn’t contain JavaScript.

Never use this tag to hide any unrelated content or links you wouldn’t otherwise show site visitors.

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

When I was called on as a search engine expert in court a few years ago, I discovered 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, JavaScript can benefit the user experience. From the search engine’s perspective, JavaScript can be a red flag for spam.

Before adding any type of JavaScript and tags to your site, determine if the extra code is necessary. If the JavaScript is well written, the tag is unnecessary. And, many sites get qualified traffic from the search engines without JavaScript in the design.

Want more search information? ClickZ SEM Archives contain all our search columns, organized by topic.

Subscribe to get your daily business insights

Whitepapers

US Mobile Streaming Behavior
Whitepaper | Mobile

US Mobile Streaming Behavior

5y

US Mobile Streaming Behavior

Streaming has become a staple of US media-viewing habits. Streaming video, however, still comes with a variety of pesky frustrations that viewers are ...

View resource
Winning the Data Game: Digital Analytics Tactics for Media Groups
Whitepaper | Analyzing Customer Data

Winning the Data Game: Digital Analytics Tactics for Media Groups

5y

Winning the Data Game: Digital Analytics Tactics f...

Data is the lifeblood of so many companies today. You need more of it, all of which at higher quality, and all the meanwhile being compliant with data...

View resource
Learning to win the talent war: how digital marketing can develop its people
Whitepaper | Digital Marketing

Learning to win the talent war: how digital marketing can develop its peopl...

2y

Learning to win the talent war: how digital market...

This report documents the findings of a Fireside chat held by ClickZ in the first quarter of 2022. It provides expert insight on how companies can ret...

View resource
Engagement To Empowerment - Winning in Today's Experience Economy
Report | Digital Transformation

Engagement To Empowerment - Winning in Today's Experience Economy

2m

Engagement To Empowerment - Winning in Today's Exp...

Customers decide fast, influenced by only 2.5 touchpoints – globally! Make sure your brand shines in those critical moments. Read More...

View resource