logoalt Hacker News

tostiyesterday at 8:36 AM4 repliesview on HN

That and there's no HTML way to interactively load results. Or are you really going to serialize half a million records to HTML and transfer it all every time the relevant block is added to a page? What if it sits in the header or footer templates?


Replies

freedombenyesterday at 6:28 PM

Indeed, and if I have to build a component for it in JS anyway, I'm highly likely to just reuse that component everywhere I need it rather than have to build, style, and test different implementations in the same app.

_heimdallyesterday at 12:09 PM

This would be possible in XSLT, if only browsers would implement the latest spec rather than abandoning it all together.

singpolyma3yesterday at 6:10 PM

Half a million might be pushing it, but you'd be surprised how much you can inline without any penalty these days.

6510yesterday at 1:58 PM

Right, I sort of expected there to be an attribute for an url.

   <datalist json="search.php?q=toyota+corolla">
But then you would want to send other form values along with it which might make things more complicated than it should be?

Static could be better too. When search engines first started building these auto complete dropdowns the multi word input was really the killer feature. To have something like "green toyota" you would have to generate an element for all color and brand combinations? And the you want it to work for "green toyota corolla" and you get an abc kind of list length.

Perhaps a wildcard would have been fun or regex options.

  <option value="* days"></option>
  <option value="* weeks"></option>
  <option value="* years"></option>