Weblog entry #122 for Steve

Ajax
Posted by Steve on Mon 7 Aug 2006 at 22:22
Tags: none.

I've updated the site search to use Ajax.

Good? Bad? Useful? Pointless?

Just type a word like "virtual" into the search box to give it a go ..

 

Comments on this Entry

Posted by trollll (24.153.xx.xx) on Tue 8 Aug 2006 at 00:28
[ Send Message | View Weblogs ]
Interesting, though I think it needs a sizable speed boost and "busy" indicator. It took long enough that I thought I had to hit return to trigger it.

I personally prefer the additions of things like Ajax poll handling and comments before searches.

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Wed 9 Aug 2006 at 11:37
[ Send Message | View Steve's Scratchpad | View Weblogs ]

The thing about doing other things in Ajax is that they are more work...!

Comment handling, and poll submissions, should always work regardless of client so I'm reluctant to change them massively.

Things like the search addition are just nice little extras, which don't matter too much if they are broken or non-perfect.

I'll try to work on it a little more this evening and implement a couple of the suggestions which were left here. But if it turns out to be too slow still I'm happy enough to just write it off as a failed experiment.

I'm adding things like this because I think they would be kinda-useful, but if the drawbacks start outweighing the convience they'll just go. I don't see the need to make things Ajaxy just for the sake of it..

Steve

[ Parent | Reply to this comment ]

Posted by trollll (24.153.xx.xx) on Tue 8 Aug 2006 at 00:59
[ Send Message | View Weblogs ]
I just took a look at the requests and noticed something:

Typing "backup" yields this request:
http://www.debian-administration.org/search/suggest/b

"xen" fired these two requests:
http://www.debian-administration.org/search/suggest/xe
http://www.debian-administration.org/search/suggest/xe

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Wed 9 Aug 2006 at 11:30
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Exactly.

These URLs are used to return tags which have been set on articles which match the submitted text. (I could probably do a better job than just matching tags, but it seemed like a simple place to start with.)

The requests are fired onKeyUp so the timing and number of requests is a little random..

Steve

[ Parent | Reply to this comment ]

Posted by fsateler (200.83.xx.xx) on Tue 8 Aug 2006 at 03:55
[ Send Message | View Weblogs ]
The suggestion box doesn't close here, neither in konqueror nor firefox, so if I type something, and then delete everything, I get the full list.
--------
Felipe Sateler

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Wed 9 Aug 2006 at 11:30
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Strange. I'll look into it.

Steve

[ Parent | Reply to this comment ]

Posted by linulin (89.110.xx.xx) on Fri 11 Aug 2006 at 23:44
[ Send Message ]
The same in FF 1.5.0.6 for Windows.

Besides that, entering letters in Russian encoding results in a few seconds browser hang up, and then "Bad request!" "Error 400" suggestion box.

...Bye..Dmitry.

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Tue 8 Aug 2006 at 06:08
[ Send Message | View dkg's Scratchpad | View Weblogs ]
i like it, although i'm not sure how necessary it is. But it's fun!

A couple notes that might make it more directly usable to me:

  • set the cursor:pointer style on the individual elements in the list, so that it's clear they are clickable. (maybe also change color on hover)
  • After clicking on the element, yawns fills the term into the search input box and clears the results field: that's good! But it would be better if it then also put the keyboard focus back in the search box, so you could press Enter to run the search.
  • It's not clear to me when the results list actually refreshes. if i type "backu", sometimes it only shows "backups" and sometimes it shows "backports" and "backups" (as though it was only responding to the trigger for "back"). If you could track all outstanding AJAX requests and cancel them when a new trigger happens (onchange, i assume), that might work around this. (note: i haven't had a chance to dig through the code yet, so maybe yer already trying something along these lines).
  • Once while playing with it (just once) i had an AJAX query not return at all and it seemed to freeze my browser while this was happening (or maybe it just froze that tab. i haven't been able to reproduce the behavior).
Nice to see this kind of experimentation at any rate! Thanks for all your work on the site, Steve.

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Wed 9 Aug 2006 at 11:34
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Thanks for the comprehensive feedback!

set the cursor:pointer style on the individual elements in the list, so that it's clear they are clickable. (maybe also change color on hover).

Good idea. I will do that.

After clicking on the element, yawns fills the term into the search input box and clears the results field: that's good! But it would be better if it then also put the keyboard focus back in the search box, so you could press Enter to run the search.

Good idea again.

It's not clear to me when the results list actually refreshes. if i type "backu", sometimes it only shows "backups" and sometimes it shows "backports" and "backups" (as though it was only responding to the trigger for "back").

A new request is fired "onKeyUp", so it is a little arbitary. I think it will depend on the browser you're using, and how "busy" it is.

Once while playing with it (just once) i had an AJAX query not return at all and it seemed to freeze my browser while this was happening (or maybe it just froze that tab. i haven't been able to reproduce the behavior).

I've not seen that happen, but if it does I'll endeavour to fix it.

Mostly I regard these kind of Ajaxy things as not necessary, but kinda neat when they work. Thats why the commenting system which is something the site really needs isn't ajax because I am not sure I could do it right, and because I don't want to reject non-Javascript users.

Steve

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search