Ajax請求搜索詞點(diǎn)擊統(tǒng)計(jì)實(shí)現(xiàn)的代碼片段,以下代碼為項(xiàng)目開發(fā)中的片段,實(shí)現(xiàn)方法思路僅供參考。
//搜索詞點(diǎn)擊統(tǒng)計(jì)
$('.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);
}
});
});
//搜索詞點(diǎn)擊統(tǒng)計(jì)
$('.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);
}
});
});