4 ms·
Google's 404 Page
- gghootch 15y agoGoogle uses some clever trick to hide the closing tags in your browser. Download the file and open it in your editor of choice, the closing tags are there. http://i.imgur.com/vCyrY.png http://i.imgur.com/vCyrY.png EDIT: Or chrome is auto-adding the tags? As mentioned below curl doesn't replicate the same results, nor does Firefox.
- sramov 15y agocurl www.google.com/lalalala
- exupero 15y agoThe WebKit inspector adds closing tags. You have to view source or use curl.
- csulok 15y agowell no, the browser adds them when it loads and parses it for rendering. the inspector just shows you what the browser created. the same is true for all browsers, their inspectors will reveal how the DOM looks like for the browser.
- joshma 15y agoIf we're discussing semantics here, when a browser parses it for rendering what would it mean to "add them?" After all, the HTML is only a textual representation of the rendered DOM tree. I think it's perfectly valid to say the inspector is adding them in, since the browser doesn't really bother to adjust the HTML if it can already parse it.
- deleted 15y ago[deleted]
- mmahemoff 15y agoPaul Irish recently shined a light on the Google 404 page in his talk on the primitives of HTML5: https://www.youtube.com/watch?v=WxmcDoAxdoY https://www.youtube.com/watch?v=WxmcDoAxdoY (around 19:20). In the talk, he explains that all this is valid HTML5. You don't need quotes, you don't generally need closing tags. Whether you choose to them depends on how dirty it makes you feel, but few browsers will actually care. A separate but related lesson is that Google cares a ton about performance, so you'll often find these byte-saving tricks in high-traffic Google pages. e.g. the use of "//foo.com" instead of "http://foo.com http://foo.com.
- csulok 15y agothat's not bytesaving, that's called protocol relative URLs, meaning if the linking page is https, //foo.com will be loaded as https://foo.com https://foo.com. most google properties have https modes, this is a way to reduce the complexity of the page and whatever generates the html code.
- AndrewDucker 15y agoIf you look at http://code.google.com/speed/articles/optimizing-html.html http://code.google.com/speed/articles/optimizing-html.html you'll see what HTML allows you to get away with...