You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
805 B
31 lines
805 B
5 years ago
|
<!DOCTYPE html>
|
||
|
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<title>jquery</title>
|
||
|
<script src="js/jquery-3.3.1.min.js"></script>
|
||
|
<script>
|
||
|
function sendAjaxPost(){
|
||
|
let json = {
|
||
|
}
|
||
|
$.ajax({
|
||
|
type: "POST",
|
||
|
url: "loadBooks",
|
||
|
contentType: "application/json; charset=utf-8",
|
||
|
data: JSON.stringify(json), /*传给后端的数据格式json*/
|
||
|
dataType: "json", /*后端返回的数据格式json*/
|
||
|
success: function(data){
|
||
|
alert(data);
|
||
|
},
|
||
|
error: function (message) {
|
||
|
alert(message);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body onload="sendAjaxPost()">
|
||
|
|
||
|
</body>
|
||
|
</html>
|