Digital MarketingSearch MarketingSearch Engines and JavaScript

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.

Related Articles

Customer reviews: The not-so-secret SEO tactic

Content Marketing Customer reviews: The not-so-secret SEO tactic

4w Mike O'Brien
How to carry out an effective PPC competitor analysis

Paid Search How to carry out an effective PPC competitor analysis

1m Clark Boyd
Are your keyword research tools ready for Google's next update?

Search Tools Are your keyword research tools ready for Google's next update?

3m Clark Boyd
The three best B2B marketing channels for small businesses (and how to use them)

Content Marketing The three best B2B marketing channels for small businesses (and how to use them)

7m Chris Camps
Sears: The Holy Grail is marrying data, mobile, marketing and merchandising

Analytics Sears: The Holy Grail is marrying data, mobile, marketing and merchandising

8m Andy Favell
What does visual search mean for ecommerce in 2017?

Ecommerce What does visual search mean for ecommerce in 2017?

4m Chris Camps
What does voice search mean for your local SEO strategy?

Ecommerce What does voice search mean for your local SEO strategy?

7m Chris Camps
Attribution, integration and replication: The challenges facing advertisers in the digital age

Digital Advertising Attribution, integration and replication: The challenges facing advertisers in the digital age

7m Andrew Warren-Payne