Hi everyone i have one problem with my ajax tag search system. Following code working fine just one searching tag. But if i search multiple tag then it is not working. What i need to do here? What i am missing anyone can help me here ?
For example: When i write #innovation the the ajax will showing #innovation but when i search multiple tag like #innovation asking #stackoverflow then it is not searching #stackoverflow
$(document).ready(function() {
var start=/#/ig;
var word=/#(\w+)/ig;
$("#contentbox").live("keyup",function() {
var content=$(this).text();
var go= content.match(start);
var name= content.match(word);
var dataString = 'searchword='+ name;
if(go!==null && go.length!==0) {
$("#msgbox").slideDown('show');
$("#display").slideUp('show');
$("#msgbox").html("Type the name of someone or something...");
if(name!==null && name.length!==0) {
$.ajax({
type: "POST",
url: "boxsearch.php",
data: dataString,
cache: false,
success: function(html) {
$("#msgbox").hide();
$("#display").html(html).show();
}
});
}
}
return false;
});
});
I think the problem is the following line :
var start=/#/ig;
var word=/#(\w+)/ig;