CZ_OpenSpice/Server/template/spice/spice4.html

32 lines
775 B
HTML
Raw Normal View History

2021-01-22 12:09:14 +00:00
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<button id="send">发送复杂数据</button>
<script>
var data = new Object();
data["name"] = "XerCis";
data["message"] = "This is the message from ajax(spice4) !";
data["number"] = "2015012755";
data["grade"] = new Array();
data["grade"].push({"Chinese": 70});
data["grade"].push({"Math": 80});
data["grade"].push({"English": 90});
$("#send").click(function () {
$.ajax({
type: 'POST',
url: "/test",
data: data,
success: function (response) {
alert(response);
}
});
})
</script>
</body>
</html>