tags:

views:

187

answers:

5

2 questions, i was doing nothing productive, and tried selecting the google home page (a left click drag and select whole page) on google.com

i see that beside the search box, on the left side, there is an empty space &nbsp; i looked up the source code and there indeed was a <td width=25%>&nbsp;</td> stupid as it may sound, but i was still curious to know why the blank space is out there..or is it just a simple typo?? :)

also, any idea what window.lol&&lol() does? curious yet again, google search didnt get me any result and i thought i would turn to stackoverflow to enlighten me...

thanks, ivar

+2  A: 

For the first part, its probably just a spacer cell to help with layout.

for the second part, that checks that the lol function exists in global scope and evaluates the result of it if it does exist. otherwise it never gets to executing the function thus preventing an error.

to clarify if you have the following:

if (window.lol)

this evaluates to true if lol exists in global scope.

if (lol())

this evaluates the result of lol as a boolean

put them together and its just a slightly more complex boolean evaluation

Darko Z
+2  A: 

There's a 25% td with empty content on both sides of the search box. It's how google forces the middle td with the search input box to the center with ~50% width.

window.x && x() is a simple way of saying "call x(), but only if it exists in the window scope." Due to how the && operator works (it's short-circuiting), the second half is only evaluated if the first half is true. Since null values are false, if the function doesn't exist in window scope, the && short-circuits and the function is never actually called, preventing a Javascript error.

Amber
+1  A: 

i see that beside the search box, on the left side, there is an empty space   i looked up the source code and there indeed was a   stupid as it may sound, but i was still curious to know why the blank space is out there..or is it just a simple typo?? :)
This is probably to ensure that the row containing that cell has the minimum height of the height of a line. Perhaps the search bar [which is on the same table row as the cell specified in your question] is sized to 100% of the height of its containing cell?

also, any idea what window.lol&&lol() does? curious yet again, google search didnt get me any result and i thought i would turn to stackoverflow to enlighten me...
If window.lol is defined [and it isn't] the lol is called.

ItzWarty
window.lol=function(){window.onresize()}} just noticed :) thanks
topgun_ivard
+1  A: 

I think the better question is... why is Google still using tables for layout?

Daniel
To support older browsers, probably. It also helps browsers like Links.
ItzWarty
Google likes supporting EVERYTHING. Therefore if you are a masochist and want to install IE4 for example, Google will look the same. Ok maybe not IE4 but im pretty sure that at least IE5.5 is still supported for search.
Darko Z
A: 

Google likes supporting EVERYTHING. Therefore if you are a masochist and want to install IE4 for example, Google will look the same. Ok maybe not IE4 but im pretty sure that at least IE5.5 is still supported for search. – Darko Z May 24 at 5:37

You mean like how Google just dropped Internet Explorer 6 support?

dawpa2000