<!DOCTYPE html>
<html>
<head>
<title>测试</title>
</head>
<meta charset="UTF-8">
<body>
<center>
<button id="btn">点击请求</button>
</center>
</body>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
$("#btn").click(function(){
var token = "d3f8b6c1a75f31f881ag5s4f8a5gkha43";
console.log(name)
$.ajax({
type:"POST",
url:"请求地址",
data:{token:token},
datatype:"TEXT",
success:function(data){
if(data){
alert('ok');
}else{
alert(data);
}
}
});
});
</script>
</html>