ABC’s of SEO: J is for Javascript

Posted by in ABC's of SEO on October 26th, 2011 2 Comments

Javascript is the most popular dynamic scripting language on the internet, and is responsible for some of the internet’s more advanced web applications. Javascript can help pack a lot of information into dynamic menu systems, and is commonly used on ecommerce sites to create large navigational menus, processing forms and submitting orders. SEOs sometimes warned against the use of javascript, claiming that it increases the code bloat of a website as well as inhibiting search engines from reading and indexing the keyword rich content contained within the code.

5770468756 82d620bb61 ABCs of SEO: J is for Javascript

Search engines can’t always read javascript – sometimes it can be coded in a way which hides keywords, anchor text and links from the search engines, so why do we see so many large e-commerce sites with this type of javascript navigation? Largely because ecommerce site’s wouldn’t be able to handle some of the more complex operations such as sending and receiving data to a database without interfering with the look and behaviour of the website.

Normally javascript code is referenced to external .js files within the <HEAD> tags of a page, but it can be contained inline within any part of a page. A .js file can be created containing only the javascript code, as <SCRIPT LANGUAGE=”JavaScript” SRC=”example.js”></SCRIPT>, it is wise to keep these references down to a minimum instead of placing reams of javascript inline. In fact it makes some sense to position javascript code further down the page, the suggestion being that the Googlebot can get bored and wander off before scanning the entire document. If this is the case then we want navigational links and content to be indexed as flat html rather than javascript code.

Javascript being a no-no for SEO is a myth – it just needs to be properly planned to ensure that search engines can find the content. Remember that your website is not just for Google to crawl and index, it’s also for your audience, and javascript can be a useful way of providing enhanced user interfaces.

Earlier in the month Google announced the development of a new web programming language, Dart, which a leaked memo confirms is designed to “ultimately to replace JavaScript as the lingua franca of web development on the open web platform.”

pixel ABCs of SEO: J is for Javascript