使用Ajax请求搜索词点击统计实现代码片段

使用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<

(0)
运维的头像运维
上一篇2025-02-18 00:14
下一篇 2025-02-18 00:15

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注