Author Topic: AJAX/JS Code Resources  (Read 2646 times)

Perspective

  • badfish
  • Jackass In Charge
  • Posts: 4635
  • Karma: +64/-22
    • http://jeff.bagu.org
AJAX/JS Code Resources
« on: March 13, 2008, 05:33:52 PM »
I'm looking for some frameworks or code snippit repositories with some common AJAX/JS stuff to avoid reinventing the wheel.

My first target is a "suggest" style text box that can auto-complete (via highlighted completions like open office) or suggest (via a list box like "google suggest").

The number of possible completions could be huge (say, 10s of millions) so I'm not sure how this should be done (Ship the whole list client side on the initial page load then just use a trie or prefix hash index OR AJAX request for some prefix after the first few letters are typed... too slow?).

Any suggestions (for resources or for the problem described above)?

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: AJAX/JS Code Resources
« Reply #1 on: March 13, 2008, 08:55:24 PM »
I've found this site useful:
http://www.dhtmlgoodies.com/
This signature intentionally left blank.

Perspective

  • badfish
  • Jackass In Charge
  • Posts: 4635
  • Karma: +64/-22
    • http://jeff.bagu.org
Re: AJAX/JS Code Resources
« Reply #2 on: March 13, 2008, 10:21:43 PM »
nice!

http://www.dhtmlgoodies.com/packages/dhtml-suite-for-applications/demos/demo-auto-complete.html

Thanks. I haven't looked at the code yet, but from the demo it looks like they wait for the first key press, then retrieve then index for that key. Seems to be pretty responsive (of course that depends on the server and client connection) and the list of cities has to be decently sized. This should be a great starting point.

Perspective

  • badfish
  • Jackass In Charge
  • Posts: 4635
  • Karma: +64/-22
    • http://jeff.bagu.org
Re: AJAX/JS Code Resources
« Reply #3 on: March 14, 2008, 10:50:09 AM »
well after looking at the code, the list of cities in the demo is small and sent direct to the page all at once. It pauses to load because of a linear scan. Anyway, I think I should be able to use AJAX to request smaller files after key presses.

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: AJAX/JS Code Resources
« Reply #4 on: March 14, 2008, 12:48:23 PM »
For some reason I seem to recalling seeing that Google made their API available for the "suggest" feature but I'm having trouble finding the page right now.
This signature intentionally left blank.

Canuck

  • Eh?!!
  • Founders
  • Posts: 792
  • Karma: +51/-3
  • Andy Moog Fan
    • My Website
Re: AJAX/JS Code Resources
« Reply #5 on: March 15, 2008, 01:58:59 AM »
Oooh, I was looking for something like that for the website Im working on.. I have to test it out with my data to see how long it will take to load.

Also going to use the calendar scrip on there to populate a form.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: AJAX/JS Code Resources
« Reply #6 on: March 15, 2008, 08:11:43 AM »