JavaScript and SEO

42-15325215Baidu doesn’t, yahoo doesn’t, and I am pretty sure bing (the new Microsoft search engine) doesn’t. Doesn’t what you ask? Index javascript. So you now ask, “How do I design a site or page with Java links?” The short answer is do not to use javascript links whenever you can, and always defer to the old html link tag <a href=”” title=””> </a>

Everybody knows that pure HTML is useless to make complex sites with good functionality Web users need.  That’s why programming languages like JavaScript or PHP are able to jack HTML performance.

If JavaScript is in the HTML file itself (rather than in an external .js file that is invoked when necessary) this clutters the HTML file itself and spiders might just skip it and move to the next site. Google states  “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.”

However, now that I just told you how Javascript and SEO was, lets talk about how it is going to be with Googles new efforts to recognize and index via javascript!!!

Yes, google can understand some javascript links, and soon, will  able to understand even more. Google just announced at the googe I/O their intent to dig deeper into Javascript.

What are the javascript links google can currently understand?

google can understand the following javascript links :

  1. <div onclick=”document.location.href=’http://gotothispage.com/'”>
  2. <div onclick=”myfunctionname(‘gotothispage.html’)”><a href=”#” onclick=”myfunctionname()”>that’s a cool page dude</a>
  3. <a href=”javascript:void(0)” onclick=”window.open (‘youcometothispage.html’)”>please open this page</a>

How devastating could JavaScript actually be? Generally speaking, if not properly used, it may do the following to your SEO efforts:

  • It may hamper the ability of search engine crawlers to read page content.
  • If used in navigation, it may prevent crawlers from seeing the links.
  • It may change keyword density in your text content.
  • It may change link juice distribution, page weight and PR.

Despite all the obstacles JavaScript may present to SEO, many web designers are still huge fans because it creates dynamic web pages that html codes can hardly achieve.

So if you have to use JavaScript in website development, is there any way to minimize its negative impact on SEO? Here are some tips:

  • Never use JavaScript in navigation menus and internal links which play a vital role in guiding search engines to the web pages in order to create entries for index. Obviously, if a web page cannot be crawled, it won’t be indexed. If you just want to use JavaScript to make a dynamic navigation menu, you can achieve similar but much more SEO-friendly result by using DHTML and CSS.
  • Try not to use JavaScript in page content, either. Pay special attention to content text that you’ve created to achieve desired keyword density. Otherwise, keyword density could be diluted.
  • If JavaScript has to be used, use “document.write” or place the script in .js files.
  • If you’re not able to place JavaScript in .js files, place it underneath the html code to reduce the disruption that it may cause.

Bonus Tip:

JavaScript has its Yin and Yang. While SEOers suggest using JavaScript cautiously, it can actually benefit SEO by preventing search engines from crawling pages that you want to hide (mind you, “no-follows” in your meta can do some of this job, too!), such as ads, terms of use and privacy statements. You can place all these content in .js files to increase relevance of your web site.

Leave a Reply

Your email address will not be published.