使用Ajax请求搜索词点击统计实现代码片段
Ajax请求搜索词点击统计实现的代码片段,下面为项目开发的代码片段,实现方法思路仅供参考。
//搜索词点击统计
$(‘.hot-word’).on(‘click’, function () {
var id = $(this).attr(‘data-id’);
var words = $(this).attr(‘data-words’);
$.ajax({
type: “post”,
url: Config.searchWordsUrl,
data: {
id: id,
words: words,
‘_csrf-frontend’: $(‘meta[name=”csrf-token”]’).attr(‘content’)
},
dataType: “json”,
success: function (message) {
console.log(message);
}
});
});
文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/115079.html<