Wouter Dorgelo
Wouter Dorgelo

Reputation: 11998

Why does google.com not use double quotes around the values of some HTML attributes?

I was looking at the sourcecode of google.com (the web-rendered version ofc. ;-)) and I noticed that they don't always use double quotes around the values of some HTML attributes, like:

<a onclick=gbar.qs(this) class=gbmt id=gb_10 href="http://books.google.com/bkshp?hl=en&tab=wp&authuser=0" onclick="gbar.logger.il(1,{t:10})">Books</a>

What's the advantage of coding your site like this?

source: www.google.com

Upvotes: 7

Views: 155

Answers (2)

Strelok
Strelok

Reputation: 51461

I believe this is done to minimize the size of HTML of the page as much as possible. Because when you are serving as many pages as google every byte counts. I remember quite a while ago there was an article about it. They also don't close a lot of the opening tags and some other stuff.

EDIT: Found the article from 2 years ago: http://blog.errorhelp.com/2009/06/27/the-highest-traffic-site-in-the-world-doesnt-close-its-html-tags/

Upvotes: 2

Kevin Peno
Kevin Peno

Reputation: 9196

Because HTML doesn't care. Quotes are not required. In the case of a boolean attribute, it doesn't even need a value either at times (ex. disabled vs. disabled="disabled"). Only XML (and XHTML served with an XML mimetype) cares about syntax in this way because XML spec defines these are required.

Upvotes: 4

Related Questions