Javascript and SEO: The new school.

Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information.

DOM Scripting is changing the old rules of SEO. I was raised to believe that javascript hindered a sites readability by search engine spiders and should be avoided at all costs. Of course, I come from an era where images were sliced apart and held together with tables, and rollovers were created with javascript code and multiple hits on the server. Sadly, this is still common practice these days.

There are two things that are replacing the need for the old school way of using javascript in web sites. One is CSS. You can create CSS rollovers, with minimal, if any, javascript, that make fewer hits on the server and are degradable in all browsers. And more accessible, without the need for noscript tags. In fact, CSS can replace a lot of the javascript effects we’ve used in the past. Even flyout and dropdown menus are possible using CSS (only Internet Explorer requires a touch of javascript).

The second thing that is changing the way we use javascript is DOM scripting, and the related buzzword “unobtrusive” javascript. Thanks to the DOM, we can run scripts that add javascript behaviors after the page has loaded, without including any javascript in the actual markup. This means browsers without javascript, or search engine spiders that don’t read javascript, are faced with pure XHTML without a hint of javascript to dilute the text to code ratio. That’s a beautiful thing.

So the old rules don’t apply to the extent that they used to. You can still create a site that is accessible and search engine friendly and use a few effects or a little scripting at the same time. In fact, making a truly cross browser, cross platform site can even require the use of javascript, such as in the case of progressive enhancement. But there are caveats. You still have to worry about page bloat, even if you’re including your scripts from external files. Page load time is still affected by the total amount of javascript the browser has to interpret. And you still have to have valid markup as a building block for your scripts to work with. If someone visits your site without javascript, they should still be faced with a functional and good looking site.

So a lot of what I used to believe no longer applies. I use javascript in ways I never thought I would. I’m starting to allow myself the freedom to apply javascript to forms and exploring AJAX and having just a little bit more fun with the web. Thanks, DOM.

» » » » » » » » »

Comments are closed

Comments are currently closed on this entry.
  1. 6Cycle 08.11.06 / 4pm

    Really great discussion. I remember when I first started coding (referring to an earlier entry), it was on my Dad’s beat-up IBM, and I started in BASIC. Then PASCAL. Then COBOL.

    But my trickiest language to master? C. I.A. (information architecture) runs a close second in terms of complexity. The nuances of knowing viewer habits and being able to capture them and respond. It’s just so…well, I bet you know now, too.

    I love your diatribes, they’re informative and very witty.

  2. Brendon 11.29.06 / 6am

    Is there any special techniques that can be used to optimize a wordpress blog on my server for SEO. One issue I see is no way to change the title tags on each page, where it seems to take the blog name for the home page.
    I have several hundred 600+ inbound links.
    I have pinged Technorati manually and used pingoat as well as pingomatic every time I add a new blog.
    There is plenty of content, about 30 articles.
    What else can I do? What else should I do to optimize my blog?

  3. brett 11.29.06 / 6am

    Check out this link:
    http://codex.wordpress.org/Search_Engine_Optimization_for_Wordpress

    Pay special attention to the part on Meta tags (there are plugins that will change your page titles and meta information based on content and title of the article), sitemap plugins and the reference links at the bottom.

    Also, if you’re not using a tag system, check out Ultimate Tag Warrior. It will definitely help with your Technorati placement.