Thursday, June 07, 2007

Google source

I may be the last person to discover this, but I was alerted to the oddities of Google's "html" source in a book that I picked up in Turin -- one that is definitely critical of Google, but in a decidedly European way (where else could you find that there are numerous Marxist criticisms of Google and its power over information?). So I now ask you: have you looked at the source code for Google's pages?

First, do this: run your mouse over the buttons on Google's home page. (There are only two of them.) We've all had drummed into us that every .gif needs an alt text for the purposes of accessibility. Hmmm. No alt text appears.

Now, look at the source code to confirm that the buttons don't have alt text. Hmmm. No buttons. At least, no "img" tag. There's a lot of code here, and I can find this:
<input name=btnI type=submit value="I'm Feeling Lucky">

But there's very little here that I recognize as standard html. I tried running some basic accessibility tests on the page (I'm no expert in this area, so my tests may have been too simple) and there were some errors, but none of the ones I saw were considered terribly important. I don't know, however, if the accessibility testing software understood the Google source code, nor if typical screen reading software would be able to determine from the code that there are buttons and that those buttons have names. So if anyone has any insight into this, I would be very interested to hear it.

Note that all of Google's pages seem to use this non-html style coding. I'm willing to believe that it is more efficient this way, but I wonder about what it means for compatibility, for competition, and for users.

7 comments:

Unknown said...

I believe it has a lot to do with code optimization, as outlined here: http://sitearticles.com/cms/show/79.html

They do still use some non-standard tags, such as <nobr>. I assume it works well enough that they consider it worth keeping in.

Anonymous said...

Viewing the source, there is an inital script followed by standard html. It degrades gracefully---so if you open the site in a text only browser such as lynks or links it works fine with the labels displayed in plain text. So I doubt that there are serious accessibility issues, but I am no expert.

Dorothea said...

Buttons aren't actually images; they're text overlaid on browser widgets. So they don't need alt text.

As for the coding style, it's not exactly modern and it's not exactly XHTML, but it is (fairly grotty) HTML, just souped up with a lot of Javascript.

If you, um, Google for "google markup" you'll see that a number of standardistas have remade Google in their image.

Karen Coyle said...

Thanks, all. Yes, I was confusing buttons with .gifs. I did look at some of the results with "Google markup" as the search, and there's a certain amount of "how to get around this and make it more like real HTML" for those folks who are using Google pages in their services. The question remains: is it for efficiency, or because real coders use real code, not a sissy markup language?

Anonymous said...

LOL on the Marxist criticism.

One addition to Dorothea's comment: depending on what browser you use, you won't see the alt text when you mouse over an image. The alt is meant to show up when the image isn't there, but IE lets you see it on mouseover anyway (not sure if 7 still does this).

Anonymous said...

If you are looking for accessibility with google, you want to be using http://labs.google.com/accessible/

To find more cool accessibility tricks with google check out the the Official Google Blog (http://googleblog.blogspot.com/) and look at any articles by T. V. Raman.

Anonymous said...

Try validating the html using http://validator.w3.org/

According to the people who know, the web page www.google.com is missing pieces that could make it valid html. Doesn't mean it doesn't still work, of course ... it just isn't valid code.

And that doesn't answer your basic question about WHY they coded the page this way.

---Kurt