[eluser]Wayne Smallman[/eluser]
A typo!
I found that there weren't enough closing parenthesis.
Also, when I include the function part, the whole thing stops, but when I add the code sans the function part, the code works, but not the append part.
So the present code looks like:
Code:
function lookup(inputString) {
if(inputString.length < 3) {
// Hide the suggestion box.
$('#suggestions').hide();
} else if(inputString.length >= 3) {
$.post("http://macbookpro.local/development/theundercloud/tags/suggest", {
queryString: ""+inputString+""
}, function(data){
if(data.length > 0) {
$('#suggestions').show();
$('#autoSuggestionsList').html(data);
$('.tagadd').click(function() {
$("#tags").append($(this).text());
return false;
});
}
});
}
} // end function lookup
As I said, the new code doesn't stop the whole thing from working, but clicking a list item doesn't add the item to the field.