SEO Friendly Ajax That Spiders

SEO

by Kenny Hyder

SEO That SpidersI keep seeing all the main SEO sites put­ting up posts about how Ajax is not search engine friendly. Which, for the most part is true. But not all the way true. There is a way to use Ajax, to make appli­ca­tions that are friendly to the search engine spi­ders. It’s all just a mat­ter of how you write the javascript.

The pro­blem with javasc­ript / Ajax and search engine com­pa­ti­bi­lity is not with the search engi­nes, or even the use of javasc­ript. The pro­blem is in how the code is writ­ten. There is defi­ni­tely a way to write spi­der friendly javasc­ript. It’s called un-obtrusive javasc­ript. Which basi­cally means javasc­ript that dis­plays if the brow­ser sup­ports javasc­ript, but also dis­plays if javasc­ript is not sup­por­ted. Hence -> un-obtrusive.

There are many ways to do this besi­des using the com­mon nosc­ript tag. There is an exam­ple of such javasc­ript on the web­dev page of my other site. You can test it by going to the page, clic­king around on the javasc­ript accor­dion to see the javasc­ript in action; then turn off javasc­ript in your brow­ser prefs, refresh the page and viola! all of the con­tent still dis­plays. This is the essence of un-obtrusive javascript.

You can do the exact same thing using Ajax, or XHR (Xml Http Requests) by refe­ren­cing files on the ser­ver using links that don’t follow when javasc­ript is ena­bled and put­ting the lin­ked con­tent on the page by appen­ding it to the DOM (Docu­ment Object Model) with javasc­ript. What you get then, is an Ajax appli­ca­tion that works for the user with javasc­ript capa­bi­li­ties, and for the search engine without javasc­ript capa­bi­li­ties, it is simply a link to con­tent. Ajax/javascript can be SEO and spi­der friendly, it’s just a mat­ter of how it’s done!

{ 1 comment }

Previous post:

Next post: