I was playing with jQuery in the dev console in Chrome yesterday on the Google homepage and realized that I was writing valid jQuery, but that $("body") simply didn't exist.
I was playing with jQuery in the dev console in Chrome yesterday on the Google homepage and realized that I was writing valid jQuery, but that $("body") simply didn't exist.
They cut their bandwidth in half by not validating.
Care to elaborate on this bullshit about cutting bandwidth in half? I just want to remind you that quoting attributes and leaving out some tags is perfectly valid in HTML5 and HTML4.01. Even in strict.Converting their markup to the valid one would not be difficult, and they could even save some bandwidth. For example: drop those stupid attributes for body tag. drop <html><head> - these tags are optional. Why do you waste precious bandwidth with <meta http-equiv="content-type" content="text/html; charset=UTF-8">? Your DOCTYPE claims that page is marked up in HTML5 so use it: <meta charset=UTF-8>. Drop thet method=GET from your form: it's default. Alias your document.getElementById: you repeat it 7 times what a waste. Etc., etc.
Big picture, the W3C spec is not what matters here. What matters is making the same HTML document render exactly across different browsers. So maybe they could drop <html><head> according to W3C, but does that break the document in other browsers?
My guess is that Google doesn't care about the W3C spec in this specific regard. What matters is delivering the smallest document possible that can be rendered by as many browsers as possible.
*Grammar edit.
I have to imagine that Google.com is the most bandwidth
optimized page EVER.
Sure it is not, because I can see how it can be optimized even more — and that's just at a glance. So maybe they could drop <html><head> according to W3C, but does that
break the document in other browsers?
No it doesn't. My guess is that Google doesn't care about the W3C spec in this specific
regard.
Ok, it is their call. Anyone is allowed not to care, but why put doctype of existing standard then. Just put <!DOCTYPE foobar> or <!DOCTYPE idontcare> and be done with that.