The google suggest thing uses xmlhttprequest to grab data from a remote source. http://www.joelonsoftware.com/items/2004/12/10.html has some info on it. (and links to a few sites that do a great job explaining it.)

I had done something similar with a hidden <iframe> as outlined here. http://developer.apple.com/internet/webcontent/iframe.html

the basic idea of the iframe stuff is you load a webpage into the hidden iframe. The webpage is normally the result of a cgi that queries the data out of a database and writes the results similar to below. (I used div's for simplicity although anything you can browse via the DOM should work)

<div class=data> <div id=item1></div> <div id=item2></div> </div>
THere is then javascript code that looks in the iframe and pulls the data out of the divs. That data is then used to do something.

the xmlhttprequest stuff seems like a much cleaner solution:
a) not have to use the krufty iframe foo
b) be able to use XML rather than html tags

I haven't spent a ton of time refining the IFRAME approach so there may be some things I'm missing. I'm also not very skilled with javascript so you may be able to work some magic that I'm unaware of.


In reply to Re: Google Suggest by amw1
in thread Google Suggest by artist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.