导入地址
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
ajax
$.ajax({
url: contextPath + "/get-data", //请求地址
type: "post", // 请求方法
dataType: "json", // 返回的数据格式
data: {"name": "张三", "age": 18}, // 请求body
success: function(response) { // 成功返回
console.log(response);
},
error: function(e) { // 错误返回
console.log(e);
}
});
遍历
$("button").click(function(){
$("li").each(function(){
alert($(this).text())
});
});

3939

被折叠的 条评论
为什么被折叠?



