Google Suggest Dissected
sammykrupa writes "Google suggest Javascript code dissected and rewritten for all of you web developers out there. Cool piece of web reverse-engineering!" Joel Spolsky astutely notes that this will raise the bar in terms of how people expect the "internets" to work.
I think it is such a great idea. With google suggest people can find things with less strife. The way it works is that you start typing and it suggests things for you to search for. These entrys pop up directly under the search bar. I can help when that brain just isn't working to full potential!
they can't.
DMCA even. ;-)
Dyslexic users of slashdot, rejoice!
This really rose the bar? I don't see how.
Let's think if the way people search for stuff.
1. Try something specific
2. Try something less specific
Number 1. brings up no results on Goggle Suggest, number 2. brings up 523,334 results. Impressive, but how has this helped us search for 1. ?
Let's try an example, lets look for "C# structs"
1. Enter "C# structs" - no suggestions.
2. Enter "structs" - 425,000 results.
Grrreat.
"It's not your information. It's information about you" - John Ford, Vice President, Equifax
Here's what he was talking about:
Google with Auto Complete on Just start typing in the search field.
It's a beta feature.
Did you click the link "raise the bar" and search for "raising the bar" on the page, before making your comment?
I'm wondering if there isn't a little aggrandisement here?
I'm here for the experience, not the Hyperbole.
I don't know how happy google is about this, but there is already a FF extension to put suggest in the toolbar. Great plugin and also amazing how fast somebody implemented it!
Is the time for Sir. Joe Code-a-lot coming to an end? Will it only be the high-priced web developers who can make anything decent on the web, or will 13 year olds still be able to learn this new level of scripting-excellence?
Electrons are free; it is moving them that becomes expensive.
Unfortunately Google Suggest has really no use. If you know what you want to search for, you search for it. Suggesting search terms isn't really going to do anything apart from distract you. Hopefully this technology will be used for other things where it actually IS useful.
Eventhough it's an M$ spawned horror - It has brought a new revolution to javascript. Now it can load data from the server without having to refresh the screen. Flash has an XmlSocket , but I never see anyone use it till now (pointers please).
:)
Eventhough Google suggest looks great, I'd vote on CGI::IRC as the biggest killer HTML/Javascript browser app.
Clientside Javascript is powerful, we never realized how much
Quidquid latine dictum sit, altum videtur
Google will stop my cell phone from working? Noooooo!
While I'm very impressed with the javascipting behind this and indeed the speed of return from Google's network, I really don't see why it is being treated as revolutionary.
It could potentually save a user some time, but could equally slow down their search by confusing with a multitude of options.
Google suggest is too busy. It will make a nice crutch for some but won't help. How many times do real typists forget what word they are typing? Did WORD's predictive code help? Kinda; but all that good, NO!
I'm here for the experience, not the Hyperbole.
Try typing "porn" or "sex" or "cock" into Google Suggest. It doesn't come up with anything. I started to get suspicious when I typed the letter x to see what would come up, and got 4 or 5 variations of "xbox" but not a single "xxx" or "xxx porn" or anything.
Interestingly enough, they DIDN'T censor the racial slurs. "gay nigger" happily suggests "gay niggers from outer space" among other things. Also, type "tub" and one of the suggestions is "tubgirl".
Hear recorded Slashdot headlines on your phone! New service beta testing. Just call (248) 434-5508
i did something similiar for a customer about 3 years ago. the only difference was, that the list of possible inputs was much smaller and therefore i loaded the whole thing together with the webpage instead of making a lookup for every character (which had the advantage that this method was much faster for my site, especially because after the first time the browser cached the wordlist.)
:)
maybe i should apply for a patent before google does
Google Suggest Dissected...
... I would have fallen back on a packet sniffer to capture the data, but caught my mistake in the URL before reaching this point...
People have been contributing their two cents to how this works, but I have un-compressed (ie. re-written) Google's compressed javascript, so that the average web developer should be able to get a detailed understanding of how this works.... My final rewrite is available from my website here.
I saw the coolest thing I've seen since realizing that Mozilla was embedding a wsdl-enabled SOAP client into this browser... Google Suggest returns suggested results as you type... This is technically amazing on about at least two different levels:
1. How fast this is... I type pretty fast, and it updates with every single keypress...
2. The cool web interface... I used to be pro-server side web updates, and avoiding javascript, but I'm really turning around on this with the impressive interfaces I've seen with gmail, and now google suggest (among others...)
So everyone is impressed by this... My shock and awe goes further in terms of how nice this interface works:
1. That the suggestion list lines up perfectly with the query input field...
2. The high-lighting of the additionally suggested text (I type "fa", it suggests "fast bugtrack" and highlights the "st bugtrack" so that the next character I type wipes out it's suggestion... beautiful...)
3. The great handling of keypresses (cursors up and down...)
And After going through googles code:
4. How the javascript cache's the dynamic results so that if you backspace, it doesn't have to go back to google...
5. How the code dynamically adjusts it's main (time/alarm) driven loop based on how quickly you're getting results back from google...
So I wanted to understand the web interface and it's dynamic interface... Just a note that the good and brilliant folks at google wrote all of the code we'll be looking at here this evening... I didn't write any of it, but I will be stepping through it with you, and hopefully helping to improve everyone's understanding of this great dynamic web interface...
A couple of tips for how I went about reversing the logic here:
1. I saved the html and javascript locally... I managed to get a local copy running, and placed some alerts into the code to observe behaviour as well as using the javascript console to catch places I made mistakes renaming variables and functions...
2. The google code uses an XMLHttp object to make calls back to google, and executing the results... to fully understand the code, I need to see what google is sending back... BUT when I tried the url directly, I didn't get anything but a 404 back from google (it turns out I had mis-typed the generated url...)... I tried to have my browser go through a local proxy server, but it appears that the XMLHttp object doesn't use the browsers proxy when communicating (which means that this might not work if you're behind a proxy server... Can people confirm this??)
Looking at the main page source, just go to google and view source... At the bottom of this file, we can see a reference to javascript which drives the dynamic interaface (available directly from google here...)
The good folks at google compress their code as they should, so in order to understand it, I first re-indented it as can be seen here... Then I began the fun process of figuring out what the global variables are for, and what the various functions do, and renaming them to meaningful names... I made it pretty far as can be seen in my final re-write of Google's suggest javascript codehere
Things I didn't know before this exercise that I learned going through this...
1) You can turn the browsers autocomplete off by adding autocomplete="off" attribute to an input field... How did I not know this before...
2) The XMLHTTP / XMLHttpRequest object to communicate back with a server and get new info / ins
Google suggest is a neat idea, but a potentially destructive one.
Small sites should *not* try to do this kind of thing on a live site. The amount of pressure this could put on a bad database structure (or even a well formed one) is considerable. Think about how many database hits a user could perform in a very short space of time: (user enters something, (database hit) backspace (database hit) types another letter (database hit)), then multiply it by a hundred or more people if your site gets a moderate amount of traffic.
Google can get away with this because they have considerable bandwidth, and large server farms. We've been seeing people trying to copy google suggest for the last couple of weeks in #javascript/freenode and in #php/freenode. The people trying to copy it generally do not understand how potentially bad this can be for a single server.
Anyhow, my advice is, don't do it unless you have the resources to scale your site. The cost of such an insignificant feature (lets face it, all it does is save the user one or two clicks) seems like it outweighs the gain. If you do decide to do it, and your site gets popular, and you're on some kind of shared host, your sysadmin is going to hate you, and the other site admins will probably meet you at your house, torches in hand.
BeauHD. Worst editor since kdawson.
It's based on a hidden one-size-fits-all assertion, where size=="SUV".
People know when they're sitting behind copious bandwidth. And you could well grow accustomed to an all-text page weighing the better part of a megabyte, due to a heinous amount of information parked in hidden JavaScript data structures, giving you that near-whiplash inducing responsiveness.
(Ah, the ghosts of projects past...)
Then again, you also know when you're on a cell phone, and the information you really need is already at the top of the page, and standing by for ludicrous chrome and tailfin to download could lead you to curse.
Nothing marks an American more than an insatiable lust for overengineer, but go ahead and light off Keb' Mo' "Am I Wrong?" for a compelling counter-argument.
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
LiveSearch does something very similar, is Open Source and exists since April ;)
If you look for more XMLHTTPRequest examples, which tightly integrate JS and PHP (other server side languages would be possible), see JPSpan.
I don't quite understand all the hype about Google Suggests. The technique for doing it exists since at least 2 years on Mozilla (and even longer on IE). Therefore, doing something like that was possible since a long time, but maybe everyone was just scared of using JS for "serious" stuff..
Anyone have the gmail javascript code dissected in a similar fashion that they could send me or post a link? My email is timmerk at yahoo dot com I am just looking for JS that can dynamically draw and change the page so well, such as gmail and yahoo does with their personals page.
Free stuff without getting the referrals? http://referralaccelerated.com
I would've moderated it "no shit".
Not to dismiss the neat reverse engineering he did, but is the actual discovery that big a deal? It's just a keypress handler, and some server communication. No big deal on any graphical user interface other than a web page.
Google have good UIs because they hire smart people. Other people don't because they don't hire smart people, or hire the wrong type of smarts (graphic designer instead of sw engineer for the coding part of a website, and vice versa).
I've looked at using the XMLHTTP object a couple of times in the past, and noted that this is partly how Google Suggest works.
XMLHTTP is a COM object included with recent versions of Internet Explorer. You can call it from client side JavaScript in a web page. The object will make a request to the URL you specify, and return the result into either a string variable, or an MSXML DOM object. You can then have the javascript output the results to an object (eg, a div tag) on the page without doing a full page reload.
I wrote a small tech demo that implemented a virtual tree - so when you expand a branch in the tree the client only retrieved the data it needed. This was borrowed from the approach the MSDN web site uses. The advantages to it are that it doesn't download the same data over and over like when you expand a branch in a server side tree. You also don't have to do any work at all to remember the state of the tree since there's no full page refreshes involved.
Google Suggest is similar in that it is a virtual list rather than a virtual tree. A virtual list allows you to list lots of items and jump around in the list without needing to download the entire data set when the page was loaded.
Another use for this would be dynamic forms - forms that alter the state of controls based on selections the user made in previous controls.
The biggest suprise to me was that Google have implemented this on a site live to the public. In using XMLHTTP I found it a little bit prone to locking up the browser when waiting for responses to requests. Additionally it's Windows only, so could never have been implemented on an external web site.
I'll be looking with interest at the Mozilla side of Google's implementation, since I didn't think an equivalent existed until now. Two different implementations of the same functionality is still going put a damper on the technology though.. different code for different browsers is usually more trouble than its worth.
What you say might be true for us geeks, but have you ever seen how standard users do web searches? They begin with one-word searches, and if and only if the results don't satisfy them do they refine their search.
Engage!
I read a cool article on how it was done and how to do it with ASP.NET here:h ive/200 4/12/12/36161.aspx
http://dotnetjunkies.com/WebLog/anoras/arc
1. Google performs several possible searches for each key you press
2. Google already knows the estimated number of results for millions of queries
Both of these suggest a heck of a lot of computing power. This type of thing might not scale up for general use in the near future - but still...
we're talking massive computational power and one of the largest databases ever created.
I'm a bit worried the Googleplex is going to wake up one day and declare to all us 'organics':
"yo bitches - you work for me now"
Don't worry about it.
How about Run DMC? Code This Way...Compile This Way...
My Favourite Meme
Where it's all about personal aggrandizement and self-promotion.
Was not there a saying "Answers first, then questions" ???
Owen D. Answers first, then questions.
in D.A. Norman & S.W. Draper (Eds.) User centred system design.
LEA Associates. pp. 361-375. 1986
CC.
TaijiQuan (Huang, 5 loosenings)
Isn't just evaluating returned data security problem?
{It sets up a callback _xmlHttp.onchange event function, that will simply evaluate the (what ends up being a javascript funciton) that gets returned from google...}
This is a pretty useless technology. Google would be much better off if they focused on a better way of searching.
I mean, instead of searching for the occurrence of certain words, they should work on some kind of semantic search by which the semantic content of something is searched instead of its syntactic content.
Hi, does anyone know if google has patented this?
We have something called the disability discrimination act here in the UK, which pretty much rules out many interesting uses of Javascript if things like screen readers can't process them, and if there's no other way of providing that enhanced functionality to disabled users.
As others have commented here, I'm not convinced that the Google feature is in fact much more than eye-candy; and thus, since it doesn't really add any functionality, isn't really covered by the DDA. However, as soon as it actually becomes useful for something, then it will be covered; and I don't fancy the job of getting JAWS or something like that to interpret the JS in a meaningful way!
A week or two ago I saw Google Suggest for the first time and was equally impressed. I too attempted to look at what was going on at the client side, but gave up when I came to the nasty block of confusing code. I was not aware that javascript could do things like this such as opening up a socket and whatnot. The only things I ever used it for were basically error checking text fields and other strictly client side things. Maybe it is time that I started playing around with it again.
That differs from the well known "nothing happens till you hit the send button paradigm". So beware of type in your passwords by accident. They read everything (and turn it to statistics).
Dyslexic users of slashdot, untie! :)
This is a neat trick for searching. If you're looking to refine a search based on a particular word then being able to see the results count is actually pretty cool. It works best when there are a number of variations on the thing you're searching for. Unfortunately all the examples of this I can think of are p0rn related. I mean should I search for big boobs, big breasts. With autosuggest on I can easily see that big breast is best.
== GOOGLE SUGGEST ==
I am wearing
t-shirt.....20,000 results
coat........10,000 results
tie............2,000 results
underwear....1,500 results
nothing........700 results
== GOOGLE ADS ======
Need a tailor?
Wouldn't Amazon or eBay make more use of this technology? Google will give you results for almost anything, and as such I don't think this technology is as useful as it would be for a more limited (but still massive) database like Amazon or eBay.
Google is built upon a successful patent. This would be just one more.
Mozilla has had this (IE compatible) object since Mozilla 1.0 (Netscape 7), and Safari has it too. In the native implementations, you use new XMLHttpRequest() instead, and you can test for window.XMLHttpRequest to see if it is there. It is just a few lines of code extra.
;)
Furthermore, you can use asyncronous requests to avoid lockups. Having the Google server farm and bandwidth wouldn't hurt either, of course.
Spine World
I didn't use the XMLHTTP object to do this, but I implemented something similar a while ago. I think I originally tried to use XMLHTTP (or possibly something similar), but ran into Mozilla security issues that were blocking it from being used without requiring the user to have a heap of trust-related things set up in a friendly way. (On the other hand, I didn't go to great lengths to figure out if I was using it properly.)
The trick I used, which I borrowed from kuro5hin and it's dynamic comment fetching, was to use a hidden iframe element in the page.
Essentially you just put an iframe on the page with style=display:none (or perhaps just create one), set the location property, let it fetch the page. Then you can grab the DOM or text from it and do what you like with it. It's hacky and so obviously you have to be careful not to break things, but it's an alternative approach in some cases you might run into where XMLHTTP isn't properly supported.
how do you accidently type your password into a freaking google search box?
When logged in at Flickr (http://flickr.com/) you can quickly edit photo titles and other bits of info by simply clicking on then and typing in a new value. When you submit the value it uses XmlHttpRequest to send your change to the server without refreshing the page and works really well. Makes it really simple to make small quick changes to stuff.
With XmlHttpRequest being supported cross browser (I think Safari is getting it soon) and starting to get more mindshare I think we are going to see a lot more of this.
After seeing google suggest, I built the same thing last weekend for CPAN modules. It's at http://teknikill.net/cpan/
The next thing I need to do is include the value of the dropdown box and limit the results on that.
What I'd like to see Google do, is incorporate Google Suggest into Google Desktop Search, adding the search-as-you-type functionality one of its competitors already has.
The hard part will be to make sure it does not kill the user's computer - as someone already pointed out, this can place a pretty heavy load on the server, in Desktop's case, the desktop computer itself.
- Noam.
Joel Spolsky astutely notes that this will raise the bar in terms of how people expect the "internets" to work.
Couldn't just post the story without bashing Bush, could you?
Why can't some programmers also learn some basic English skills... Like, how you only need one period to end a sentence... And if you always use three, it makes it really annoying to read... Also: I don't think the author get's the idea of correctly realizing verb tenses...
dinosaur comics
This makes for an interesting way to sum up the internet into 26 words/phrases.
Check it out:
A - Amazon
B - Best Buy
C - CNN
D - Dictionary
E - eBay
F - FireFox
G - Games
H - Hotmail
I - Ikea
J - Jokes
K - Kazaa
L - Lyrics
M - Mapquest
N - News
O - Online Dictionary
P - Paris Hilton
Q - Quotes
R - Recipes
S - Spybot
T - Tara Reid
U - UPS
V - Verizon
W - Weather
X - XBox
Y - Yahoo
Z - Zip Codes
If I had to sum up the internet in 26 words/phrases, I don't think I could have done it better than Google. Of course, that is keeping in mind that Google Suggest has some pretty serious filters in place, so instead of P being "Porn" it is "Paris Hilton." Not too far off, if you think about it.
Damn kids, that was Aerosmith not Run DMC
Music is everybody's possession.
It's only publishers who think that people own it.
Fuck Beta
~John Lenno
I tried to go to google.com just now, and it automatically loads google.co.uk instead. When did they start doing this? It also seems to lack the fancy new auto-complete search function.
If you type in Goooooo it just keeps going on and on with more google sites until it runs out of space. Funny, the more o's you put in the more sites you get.
I view Google Search as a great interface enhancement for the tired browser paradigm.
Everybody is writing apps to work in the ubiquitous browser. Unfortunately, developers have to jump through many hoops to get browsers to sport friendly interface elements that are already available in the X / Windows / Mac interfaces. The browser was never meant to be an application front-end, but it's being forced upon us developers, costing more time to get a workable product banged out. A compiler and class libs can do so much more.
Thanks, Google, for adding another element to make people want the pathetic browser as an interface.
Mod me a troll, but browsers suck as interfaces. And I haven't even touched on printing...
I don't agree, I found it useful to search for linux kernel Oops addresses. Start typing your address as 0xc0... and the results start to narrow down to something matching yours or very near yours.
willy
So how long before somebody finds a way to do something maliciuos through this to your server? SQL injection / etc?
Some browsers/web sites switch contexts when they shouldn't. Firefox on Windows, for example, takes over the UI context (contrary to Windows UI standards) at times. Google has sites that take a second or so to load even on a high-speed link; start typing into a field in the Google Groups advanced search box, and then see the active field change so you're now typing into a different box when the page finishes loading, for example. These things are annoying at the moment, but potentially a huge liability in future if Google is picking up on every keystroke you type, and given the amount of other information they could potentially mine about you from the various services they offer.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
XmlHttpRequest to fetch data on demand has been around for a long time. For example, MSDN has been using this technique for years now. I have been using it for 9+ months on an application that recently went into production.
The reason you have not seen it in use much is
Google's best engineering continues to be in the back end - that is what makes this thing possible, and why no one else would likely be able to replicate this. The ability to search billions of records that fast is simply staggaring.
If you want to see a really amazing web interface, then check out Microsoft's Outlook Web Access 2003 (the web interface to Exchange 2003).
While they do use HTC's and behaviors, the result is astounding -- a fully responsive, dymamically updating UI that never needs to go back to the server for a full-screen refresh. It also looks and feels exactly like using Outlook 2003 on the desktop, drag-n-drop, sorting, right-clicking and all.
What we really need is a cross-browser way of coming up with a rich interface like that.
MSN Search Suggest Beta
Wolf5K is a Javascript clone of Wolf3D in 5Kbytes. I deobfuscated it and posted a series of tutorials on how it works here. There is also a C++ translation and enhancment series of tutorials here. Full ready to compile source is included for all tutorials.
The task of deobfuscating code is quite tedius but not too daunting. The main thing is getting the whitespace back in so you can see where all the functions begin and end. You then have to understand the language well enough that you can read the code and figure out what's going on without hints from comments or descriptive variables.
For Wolf5K I just started by working on the simple functions first and then by process of elimination worked my way through the code and finished with the raycasting function.
Translating it all to C++ was then quite easy because by then you have a very good grasp of how the code is suppost to work.
Work Safe Porn
There is one major problem with Google's client-side javascript magic: It breaks the back button.
This breaks the second most used user interface feature on the internet. Quote from the link: The Back button is the lifeline of the Web user and the second-most used navigation feature (after following hypertext links). Users happily know that they can try anything on the Web and always be saved by a click or two on Back to return them to familiar territory.
The auto-complete isn't really affected by this, but try it in your Gmail account. I hope they will figure out a way to fix it.
Dude. The world is changing. Change with it, or get out of the way, and let your Indian/Chinese replacement handle it.*
*I find the OP's complaint especially ironic in light of all the "I'm out of a job" complaints. Maybe the reason so many are out of a job, is because you're dinosaurs.
Someone else pointed out that this was done via frames before XmlHttpRequest existed -- I myself have written javascript apps that called the server that way, feeling very clever for coming up with the idea, and didn't find out about XHR until Google Suggest popped up, at which point I slapped my forehead.
r ame.html
Apple has a great article on how to make javascript RPCs using iframes:
http://developer.apple.com/internet/webcontent/if
It closes with a single cross-browser javascript function that first writes the iframe into the document if it doesn't already exist, then calls an arbitrary URL. They have a demo -- very impressive.
- every browser has different implementation, so portable code isn't
- some browsers (eg, links) only implement a subset of javascript, for various reasons
- some very common browsers DONT have javascript, notably lynx (still probably the most portable and safest browser in existence)
- most javascript code is redundant anyway. for example, doing input sanity checking on the client doesn't remove the need to do so on the server as well (or else you got yourself a big fat security hole)
Anyway, this guy has got to be kidding about this "raising the bar" business. Google's code is interesting concept, but it's not revolutionary. Not until a good A.I. engine is shipped, not until it stops being a dumb code that randomly guesses what you're thinking. THAT will be "raising the bar".
...and it suggests Google. How many people are searching for Google on Google?
Thinking about it, I probably don't want to know the answer.
I know that are a lot of mentions of Google on web pages, but shouldn't this service take into consideration what people are actually looking for? So, frequency of search terms instead of frequency of results.
"how to give"
Yes, people will expect more responsive Web interfaces but the 1000+ lines of codes necessary to make this work clearly shows that the underneath HTTP+HTML model is inappropriate to handle this kind of functionality. We need something more suited for fine-grain event handling.
All humans are mortal. Socrates is a human. Socrates is dead.
http://www.bindows.net/bindows/samples/applauncher /
Therefore, at present, this works only for English; with other languages it can happen that it suggests porn-prone search terms for the refinement of terms that have, as such, nothing to do with pornography. Some examples:
- the first suggestion for 'fille' (French for 'girl') is 'nue' (naked)
- the 5th suggestion for 'dzieci' (Polish for 'children') is 'nago' (naked)
- suggestions for 'mund' (German for 'mouth') countain 'mund auf sperma rein' (open mouth, introduce sperms), 'mund ficken' (fuck in the mouth), "mund arsch" (mouth ass)
- devochki (with Cyrillic letters: Russian for "little girls") gives the suggestions "devochki porno"
- the first suggestion for 'smot...' with Cyrillic letters (smotret': Russian for 'watch'/'look at') is "smotret' porno"
I think this is probably quite problematic - someone enters a search term that has nothing to do with pornography, and Google suggests something pornographic for 'refinement'. Of course, this is not due to Google's intent, but due to the distribution of the things people search for and of contents on the Internet. I suppose this is one of the problems Google will want to address before offering Suggest as an option on the main page.I don't have screen readers, but sometimes Lynx can give a rough idea how they will deal with a site. With Lynx, no suggestions are shown on the site of Google Suggest, but otherwise the page works just like standard Google search. Therefore, it might well be that Google Search works well with Screen Readers (it just doesn't provide suggestions). Actually, I think the use Google Suggest makes of JavaScript is not a problem from the point of view of accessibility - it offers something additional, but does not affect the main function (GMail is more problematic, an additional simple HTML interface should be made available for screen readers etc.).
Would you find this "impressive" if it was implemented in C++ on Windows? In Java? In C#? In ActiveX? In Gnome?
What's "impressive" about this is that it's done in Javascript and works across some browsers. But that's more of a testament to the low expectations people have of Javascript. And the solution to that is for a few browser developers to improve Javascript and its rendering capabilities, not for hundreds of thousands of developers to keep trying to work around its limitations.
Google Suggest has some pretty serious filters in place, so instead of P being "Porn" it is "Paris Hilton."
The filters do weird things. You can type as many letters as you want but it will not suggest bestiality (~2m results). However once you get to "besti" the common misspelling bestility (30K results) pops up. However, Google is not yet filtering felching.
Da Blog
Writing XHTML is really not that big of a change from writing good HTML 4.01. You basically have few "important rules" to remember:
http://personalweb.about.com/od/basichtml/a/409xht ml.htm
1. Use All Lowercase Tags
2. Nest Elements Correctly
3. Always UseEnd Tags
4. End Empty Elements
5. Use Quotes for Values
6. Give Every Attribute a Value
7. Use Code for Special Characters
8. Use id Insead of name
9. Separate Styles and Scripts
http://www.codeproject.com/html/HTML2XHTML.asp
Just as big an issue is that anyone monitoring your network will read your password, as it has been sent cleartext.
badness 10000
Doh! Google Javascript stories on two Saturdays in a row... anyone out there with a spare GMail invite so I can take a look at more than just Google suggest? ehofff at covad.net
Most web sites respond to occasional page requests; here we're asking the site to respond to each keystroke of each user in the worst case. So adding this to a page could create an accidental denial of service(DOS) attack; it could tax a good server and bring a marginal server to its knees.
One should be judicious in using this capability: the server-side script that responds to the XMLHTTP request should be extremely efficient. While Google has the resources to run such scripts, not all sites do.
If this technique were commonly used, the additional traffic could also impact the Internet by creating "billions and billions" of additional HTTP requests/responses (thanks, Carl Sagan). It would effectively turn HTTP's stateless protocol into a high-overhead version of Telnet protocol.
-MDK
Just about all of the highly modded comments seem to be complaining about how Google Suggest is not very useful.
But that is not what the story is about. The story is really about all the little things that are going on that make a very usable and responsive web interface.
Others have noted the XMLHTTPRequest object at work. But there are a number of other cool things in there:
Replacing XMLHTTPRequest with a cookie/frame reloading technique.
Using javascripts Timeout() handler to initiate server communication, so that fast typers are not penalized with a lot of excess network requests.
Interesting JavaScript text manipulation (like highlighting).
Basically, just a lot of little things that show how to make some interesting techniques useful for the widest audience possible. Google Suggest may on the face of it not look like the most useful thing ever, but you have to respect the sheer number of browsers it is designed to work on and the responsiveness of the interface.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Your post was the best post!It reallly helps to see a link that shows what is being talked about- amidst all the links posted in story.Post stories assume the reader knows what is being discussed.
I think every story should have a link about the main topic and what it is,instead of assuming the user knows it. [ most do, but some irritatingly dont].
It helps people who dont know it yet,learn.
Why does yahoo do this
i know this isa little offtopic,but i want to ask you.How do you know so many international languages?
If Joel supports it, it must be awesome! Joel can suck a cock
Slashdot sucks
unfortunately, "google suggest" is not as good as it could be.
;). so i start by typing "sou". after a short delay, google suggests "southwest airlines". ok, this seems to be what most people are searching for when entering "sou". luckily, "southwest" is the second most common suggestion listed in the drop-down list, so i just hit 'cursor-down' and 'enter' to autocomplete and search for "southwest". everything ok so far.
;)
;)
;). sure, there are people who are interested in the set union and not the intersection.. all they need is hitting backspace accordingly.
why? valuable implicit information gained through the human-computer interaction is not fully exploited by "google suggest". for illustration, see the following example:
let's say i'm searching for "southwest". and for the sake of logic, let's assume that i either don't know the correct spelling or that i'm a lazy dog
now comes the problem:
the top result displayed by google is.. southwest airlines! this of course doesn't make sense because if i wanted to search for southwest airlines, i would have happily accepted google's first suggestion already. actually, "google suggest" knows about my preference for "southwest" over "southwest airlines" and yet doesn't use this "extra-"information gained thanks to human-computer interaction! so my brain feels slightly offended
to put it simply: if an average user is selecting a search term from a list of suggested search terms, he probably wants to search for that exact search term but not for any of the other also displayed suggested search terms. if not, an average user would have probably selected another search term out of the displayed list of suggestions. so to me, this looks like if the bright google guys forgot about the fact that the act of selection from a list also implicitly includes information about what does not get selected.
suggestion for a better "google suggest":
as a probably not perfect but working solution, "google suggest" could simply exploit this implicit user interaction information by excluding all explicitly deselected (and eventually all not explicitly selected) suggested search terms from the search query. in the example:
excluding all explicitly deselected search terms yields:
southwest -"southwest airlines" (voilà! southwest airlines is not the top result anymore
excluding all explicitly deselected and all not explicitly selected search terms:
southwest -"southwest airlines" -"soulseek" -"south park" (etc.. you get the point)
that's pretty easy to implement - with an obvious benefit for average users.
disclaimer: i'm talking about expectations of average users here. iow: about users that are probably just interested in the few topmost results, i.e. the intersection and not the set union of results (but that's probably the point of web searching anyway
Agreed. I wonder how many of the complaints are coming from the former "HTML for Dummies" who use to get $100+ around the dot.com years?
That would be just like them to complain that a markup language is too hard. Hopefully bagging groceries will not tax their skill set.
How does Lynx render it? When I tried Google Suggest with my preferred ancient NS3 and javascript disabled, it still worked -- by producing a static text list of results identical to the dropdown list. To refine the search, one need merely pick one of said results, copy and paste it into a new Google Suggest search, rinse and repeat til you get where you want to be.
GMail, OTOH, is completely unusable without the lastest and greatest. Supposedly a "pure HTML interface for all browsers" is in the works, but I'll believe it when I see it. (Especially since the redesigned plain Google is broken for some browsers, due to tables that wind up "overlapping", and no amount of bug-documentation has yet changed that.)
~REZ~ #43301. Who'd fake being me anyway?
The current state of XHTML/CSS is no worse off than 'good old' HTML.
CSS is simple and straightforward. The block model is unambiguous. You specify where things go, and you know how they will behave. Various browsers may have different defaults, but if I say paragraphs have 2ems of margin between them, then that's what they'll have. In your own example, you used BGCOLOR on the table. What would've happened if you used it on a different tag... like a blockquote or a paragraph? Nothing, because BGCOLOR wasn't implemented for them.
Today, web designers can rely on the rules in the standards, rather than just using whatever happens to work in the popular browsers. No more fucking around with layout tables, spacer images or cut up designs. And advanced CSS makes 90% of the things that Javascript was used for obsolete (image rollovers, pop up menus, etc). (*)
However, none of this matters to the real Joe User. He will keep on using whatever crappy WYSIWYG tool he can get his hands on and keep polluting the web with technically valid but semantically horrifying HTML (hello Microsoft Word), wondering why the geeks are upset.
In my own experience, most of the complaints and stupid questions I get about CSS are from programmers or designers who simply haven't read the relevant standards.
(*) Relying on CSS does not work if you consider IE5/mac to be a valid target, and want IE5/win to display everything correctly.
Microsoft Internet Explorer 6.0 SP1, the newest version of IE available for Windows 98 and Windows 2000, didn't display CSS horizontal navigation list. Suckerfish Drop Down Menu uses JavaScript, which you claim 10 percent have turned off.
It it good to see js is used for more than popping up annoying ads on my screen. Now also The Linux Documentation Project offers a JavaScript driven HOWTO Generator where you just fill in the blanks, click on a button and out comes LinuxDoc SGML-code, ready for publishing.
And advanced CSS makes 90% of the things that Javascript was used for obsolete (image rollovers, pop up menus, etc). (Relying on CSS does not work if you consider IE5/mac to be a valid target, and want IE5/win to display everything correctly.)
You mean "if you ... want IE6/win to display everything correctly". The CSS drop-down menu does not show up on Microsoft Internet Explorer 6.0 SP1.
most of the complaints and stupid questions I get about CSS are from programmers or designers who simply haven't read the relevant standards.
Or for people who have read the relevant standards but don't think it's worth the effort to get 90 percent of users to switch to a web user agent that conforms to the relevant standards.
10. Use XHTML Transitional (as no popular web UA supports CSS counters yet, which are necessary for starting lists at any number but 1 in XHTML Strict)
But most importantly:
11. Exclude All IE Users (as no version of Microsoft Internet Explorer understands XHTML semantics, not even with Appendix C)
So beware of type in your passwords by accident. They read everything (and turn it to statistics).
Somehow, I doubt someone at Google sees the search term "vZ820aa3q" and thinks "oh, that's mrmorgana's Slashdot password"...
Funny. If you look at the Google Zeitgeist, you can see a whole lot of more-than-one-word searches. Okay, things like "Jessica Biel" might be considered to be one term, but how about "web hosting", "install windows xp", or "magic tricks"?
Note that there aren't a bunch of searches like "biel", "hosting", "xp" and so on, as we'd expect if people did one-word searches, and then expanded to two- or more-word searches.
Kai MacTane: Web developer for hire in San Francisco
Type "Bill Gates" and scroll down the list. And if the suggestions are based on related popular searches related to your query, I have no idea why people are interested in or wants to be Bill Gate's wife. Perhaps his small w*ng is cute?
One nice interface that does something similar to this is snap.com. I like how it allows you to refine the search from multiple selections. Much nicer than multiple pages of data to click thru. You can just close in on your desired item, back out a bit and refine as needed. Great visual tracking as you type as well. Very sweet!
"I have a cunning plan..."
It doesn't work very well with extremly long terms. For instance, I started typing lla and "llanfairpwllgwyngyllgogerychwyrndrobwllllantysili ogogogoch "(all one word) popped up, but it started to overwrite the text next to it.
Did you mount a military-grade, variable-focus MASER on an unlicensed artificial intelligence?
... being poorly implemented. I think it takes a lot of domain knowledge, hard work, and browser testing in order to get a useable and attractive mesh between server and client code. But, despite the challenges, it will become easier moving forward, as one of the new features of ASP.NET 2.0 will be to include client callback capabilities from server-side controls. It's a cool addition if used correctly and intelligently. My hope is that it doesn't get overused in inappropriate situations or without sufficient cross-browser testing.
I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.
Using suggest technology, I found a loop with its script, if you keep typing 0123456789... repetatively it doesn't end, if you do a search with about 7-9 sets of those series you can get a list of google'e employee listing! Check it out: http://froogle.google.com/froogle?q=12345678901234 56789012345678901234567890123456789012345678901234 56789012345678901234567890123456789012345678901234 56789012345678901234567890123456789012345678901234 56789012345678901234567890123456789012345678901234 567890123456789012345678901234567890123456&complet e=1&hl=en&lr=&safe=off&tab=ff&oi=froogler&scoring= p&sa=N
Cheers
The biggest problem I have with Google Suggest is not technical or moral; it's usability. If I type my entry at the speed I normally type, then the drop-box changes so fast that I end up sort of spastically trying to keep my fingers from hitting the next key. UI elements that change instantly when you hit a key are good when you're hitting a command key, but not good when they're changing in realtime in response to typing words or phrases.
To use it effectively, I have to hit one key at a time, see what it suggests, then hit the next key... tedious. And I wouldn't use it that way anyway.
It's a neat little toy, but it doesn't really seem to have a lot of useful applications at the moment. 'Course, Google's smarter than I am, so I'm sure that either I've missed something or they've got other plans.
"Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
and it's also not got a complete English filter, either. "Sex" may be there, but there are still words that can slip through...
:-/
For instance, see what options you get when searching for "jerk"...
and it's also not got a complete English filter, either. "Sex" may be there, but there are still words that can slip through...
:-/
For instance, see what options you get when searching for "jerk"...
Worst still, try "hand".
The first suggestion for "finger" is possibly acceptable if you have safesearch on, but then I doubt that's how it was searched for so frequently.
Yeeouch, and just for that I've become your foe?
My Favourite Meme
Hey, that's my Slashdot password!
This might be handy on cell phones that lack a decent keyboard. Sometimes you want the most obvious hit, but don't want to type it all.