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.
|