I'm using at.js via:
$('#post-body').atwho(
at:"@",
data: "/home/mention_autocomplete",
limit: 7
)
I would like to pass whatever the user has typed after the '@' symbol to the backend for query and returning relevant results. Is this data accessible inside the .atwho()
method?
you can use remote_filter
callback.
$('#inputor').atwho({
at: '@',
callbacks: {
remote_filter: function(query, callback) {
$.getJSON("/home/mention_autocomplete", {q: 'whatever'}, function(data) {
callback(data.usernames);
});
}
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.