在a标签里加属性值,如 首页1
$("a").mouseover(function() {
var id = $(this).attr("data-id");
$.ajax({
type: "post",
url: "test.php",
data: {
"id":id
},
success: function(msg) {
},
dataType:"json"
})
});
里面的dataType和url等要根据自己的实际情况
网页版缩进比较恶心,请原谅