//服务端
const express = require('express');
const app = express();
app.use(express.static(__dirname));
app.listen(8000);
console.log('server running');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="js/jquery-1.11.0.min.js"></script>
</head>
<body>
<script>
$.ajax({
url: '/json/example.json',
type: 'GET',
dataType: 'json',
})
.done(function() {
console.log("success");
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
</script>
</body>
</html>
显示走fail的回调,怎么解决?
后台没有路由