Making a jquery name tagger
<p>I am trying to make a name tagger in jquery + php. I have done the PHP part and jquery code is 99% done, but my problem is passing the string to search for after the '@' sign. I currently use a div with contentEditable set to true. From what I see in console log the name variable is indeed @+search string, but the list div will not be populated, I tried running the script manually just to debug and it works, including setting the name variable to one specific letter and it populates the list div. Any tips and suggestions appreciated my code below:</p>

<pre><code>$("#chat-message").bind("keyup", function (event) {
    //auto name complete
    var search = $(this).text();
    var searchbox = search.split(search.indexOf('@') + 1);
    var checker = search.substr(search.length - 1); //Checks last charcter inserted if its '@'
    var name = search.match(/@(\w+)/ig);
    console.log(name);
    var dataString = 'searchword=' + name + '&amp;search=yes';
    if (name == '' || checker == " ") {
        $("#display-search").hide();
    } else if (checker === "@") {
        $.ajax({
            type: "POST",
            url: "searchy.php",
            data: dataString,
            cache: false,
            success: function (html) {
                $("#display-search").html(html).show();
            }
        });
    }
    return false;
});
</code></pre>
