I want to implement some functions that occur when entering some text in
<input path="tags" id="input-search"/>
a list of suggested tags should appear , like

after calling ajax. I have a database query
public interface TagRepository extends JpaRepository<Tag, Integer> {
@Query("SELECT t FROM Tag t WHERE name LIKE CONCAT('%', :name, '%')")
List<Tag> findTagByName(@Param("name") String name);
}
and controller code
@RequestMapping(value = "/getTags", method = RequestMethod.POST, produces = "application/json")
public @ResponseBody List<Tag> getTags(@RequestBody Tag tag, HttpServletResponse response) {
System.out.println("Found " + String.valueOf(tagService.findTagByName(tag.getName()).size()));
return tagService.findTagByName(tag.getName());
}
javascript for ajax -
$(document).ready(function() {
$("#tag-search").autocomplete({
source: function(request, response) {
$.ajax({
url: "/app/getTags/",
type: "POST",
data: JSON.stringify({tag : request.term}),
dataType: "json",
success: function(data) {
response($.map(data, function(v,i){
console.log();
return {
label: v.empName,
value: v.empName
};
}));
}
});
}
});
});
<div class="col-md-10 col-md-push-1">
<label class="floating-label" for="login-username">Tags</label>
<form:input path="tags" cssClass="form-control" id="tag-search"/>
</div>
when I launch the application, I see this javaScript error in Developers Tools

Attention!
I use Daemonite / material for my front-end and jQuery-Autocomplete , finally it’s good that the latest version of the application on GitHub
can someone tell me how I can get rid of this error, any answer is welcome.