PATH://adammoro.net/blog/SEO/SEM/
Last Updated: February 25, 2008

Hijax. An SEO Best Practice?

With all of the non-spiderable Web 2.0-style content on the web now, the search engines must be having a wonderful time trying to index it. And I would imagine they really want to assuming that sites using such technologies are typically at the forefront of the web. Google for example recently posted an article titled, “A spider’s view of Web 2.0” which offers advice on making AJAX and other JavaScript implementations crawlable. What grabbed my interest was the reference to Jeremy Keith’s presentation in ‘06 introducing a technique for doing just that. It’s called, “Hijax” and if you really want to get the concept, leave my site now and go through the presentation.

Still here? Wow, I’m flattered. Because you obviously didn’t go to the presentation, below is a direct quote from it:

Example 1: JavaScript pseudo-protocol - Awful!

<a href=”javascript:window.open(’help.html’)”>contextual help</a>

Example 2: Pointless link - Bad!

<a href="#" onclick="window.open('help.html'); return false;">contextual help</a>

Example 3: Using the DOM - Better.

<a href="help.html" onclick="window.open(this.getAttribute('href')); return false;">contextual help</a>

Example 4: No inline JavaScript - Best!

<a href="help.html" class="help">contextual help</a>

Often times, I find myself using the “Pointless link - Bad!” example. I know enough not to use inline Javascript on search sensitive content but I have used pretty much every example above. That said I think it’s worth confirming that whenever the option exists, Javascript should always be externalized.

The Hijax Technique

Again since you didn’t check out the presentation, I’m going to pull another quote. Below are the components of the technique:

  • Begin by creating a website using traditional page refreshes.
  • Data is sent to the server via links and form submissions: the server returns updated pages.
  • Intercept (hijack) those links and forms using (unobtrusive) JavaScript.
  • Send that data to XMLHttpRequest instead of the server.
  • The server returns just the information that’s required instead of an entire page.

So essentially this is suggesting that you push the AJAX functionality to the end of the client side process. In other words, you are still using non crawlable content but minimizing the amount of it and at the same time preventing it from blocking crawlable content on your page(s).

Though I think the general concept presented by Keith is common knowledge to experienced SEOs, I also think it’s good to reinforce these points and adopt them as best practices.

Comments

  1. Jeremy Keith Says:

    Here’s another explanation of Hijax, this one in plaintext rather than slides: http://domscripting.com/blog/display/41

  2. Adam Moro Says:

    Thanks for the note Jeremy. Love the name Hijax by the way. :)

  3. baby Says:

    Nice website!!

Leave a Comment