Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

It's easy to see in Fiddler that this isn't server based, so I'm guessing that this is some sort of jQuery wizardry.


  • Detection of when auto-complete should pop up
  • Determining the list of items that can be auto-completed and displaying them
  • Finishing auto-complete (whether it be because it's no longer applicable, or an item was inserted)
share|improve this question
up vote 6 down vote accepted

There's an event handler that fires for key and click events, and checks whether the cursor is currently on a word that's preceded by an "@". If so, there's your first bullet point; if not, there's the third (note that even when an item was inserted, the cursor is still on the word, and the auto-completer is still there; otherwise you couldn't tab-cycle through the several users all starting with the same letter(s) you typed).

Regarding your second point: The chat JavaScript has a list of users it knows about, and chooses from them; the Q&A JavaScript just picks the usernames from the displayed comments. In fact, the comment auto-completer could almost 100% be implemented as a user script (and there actually was such a script, and I assume it did pretty much the same thing).

share|improve this answer
Many thanks. I thought it was something along these lines; it's easy to figure out what the list should be, but the logic for when to pop up/etc is helpful, thank you. – casperOne Nov 18 '11 at 15:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .