Slashdot Mirror


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.

10 of 321 comments (clear)

  1. A great idea by deepcameo · · Score: 3, Informative

    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!

    1. Re:A great idea by los+furtive · · Score: 4, Informative

      I agree with you in that JS menus aren't a very good idea. 10% of surfers have it turned off, and the menu is such a critical part of the site that you want it avaialable for everyone. That's why I also shake my head when I see Flash based menus.

      However, there's no need for your solution of a <menu> tag since the <ul> tag and a little CSS already does that just fine.

      Read the following articles to see what I mean:

      Hope this is of use to you.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  2. And for those who would like to see it... by Vladan · · Score: 5, Informative

    Here's what he was talking about:

    Google with Auto Complete on Just start typing in the search field.

    It's a beta feature.

  3. Firefox users can try the plugin by hobo2k · · Score: 5, Informative

    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!

  4. Re:XmlHttpRequest is cool by jasoncart · · Score: 4, Informative

    There are quite a few Flash RSS readers.

    Also, (seeing the link in your sig) parts of the BBC site use it - News for timelines (example) and CBBC used XML to pass data around flash games/apps

    The best one I've seen yet it the US Election tracker

  5. Re:Beware by broothal · · Score: 4, Informative

    Actually, it's not a new lookup in the google main databse for each keypress. It's a lookup in a pre-generated table of results.

    It's pretty easy to spot, as the number of results shown in the preview doesn't match the number of results when you hit enter.

    This makes perfect sense, since a "real" lookup would generate way too much heat. But, it's also dangerous, because people are led to believe that what they're typing would'nt yield a result. This is wrong. A simple proof of concept. Type sex. It says 0 results. But if you hit enter, you get a godzillion.

  6. DDA Compliance? by danfairs · · Score: 4, Informative

    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!

  7. Re:XmlHttpRequest is cool by Gopal.V · · Score: 5, Informative
    Read History of XMLHttpRequest.

    Microsoft implemented it as an Active-X object you could invoke from Javascript - Mozilla implemented it as a native Javascript object. Microsoft calls it "Msxml2.XMLHTTP" or "Microsoft.XMLHTTP" depending on which version of IE you are running - Mozillah has a cleaner "XMLHttpRequest" naming (soon to be in the standards I guess).

    So on IE it needs ActiveX enabled to use it . Mozilla version is therfore much safer to use and easier to program with in connection :)

    Visit simple example for a quick and dirty example :)

  8. Re:Beware by XaXXon · · Score: 4, Informative

    I think you missed the point. The "massive array" lives on the server, and when the client requests suggestions for a particular string, it is looked up in this array. Only the portion of the array that has been grabbed from prior strings is cached on the client.

    In a naive, client-side caching system, if you DID manage to request all the suggestion strings in the client, eventually you would have the entire array client side, but you'd probably start throwing away the old data at some point.

  9. Re:XMLHTTP by City+Jim+3000 · · Score: 3, Informative

    Just steal the Google code for finding out what XmlHttpRequest object the client has... it's not hard, just a bunch of try-catch clauses.

    What I think is cool about the Google implementation of XmlHttp is that it's run asynchronously so it won't lock up the page.