title: Twitter/Facebook @mention functionality with jQuery
body: <p>I'm trying to implement an @mention system in an application I'm building and am running into some difficulties.</p>
  
  <p>My initial approach is this:</p>
  
  <ol>
  <li><p>Create two hidden inputs after the textarea/input being @mentionified. The first will hold the text being searched for (for the autocomplete). The second will hold found mentions in the form @[objectId:text].</p></li>
  <li><p>This is harder to put into practice than one would think. When someone presses the @ symbol I need to start feeding the subsequent text into the autocomplete. I need to only get the text between the @ symbol and the cursor. What if they click the cursor to some other part of the input to edit something, then come back to edit the @ text. The script needs to be smart enough to only search the autocomplete when the user is updating the text right after the @ symbol.</p></li>
  </ol>
  
  <p>Thoughts on the best way to implement this? Is there a plugin out there that already does this?</p>