jsp截图()
按钮<button type="button" id="btnGetAll">查询所有GET</button>
//给 查询单个GET 按钮绑定单击事件
$("#btnGetOne").click(function () {
$.ajax({
type: "GET",
url: "/dog/" + $("#dogId").val(),//RESTful风格的API定义
date: "",
dataType: "json",
success: function (vo) {//vo是封装的数据格式类
if (vo.code == 200) {
var obj = vo.obj;
alert("Date Saved: " + obj);
if (obj == "")
$("showResult").html("没有符合条件的数据!");
else
$("showResult").html(obj.dogId + "---" + obj.dogName + "----" + obj.location + "<br>");
} else {
$("showResult").html(vo.msg);
}
}
});
headers截图
上一张截图的页面
控制台截图
依赖截图
运行是用的tomcat插件
清缓存,换浏览器都试过,和这些应该没关系
如果你的jdk是1.8,建议使用tomcat8-9之间的版本,jquery无法加载可能你的路径出现了问题,你可以使用绝对路径httpxxxxxx