<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>状态码测试</title>
</head>
<body>
</body>
<script>
fetch("www.baidu.com").then(function(response) {
console.log(response.status); // returns 200
alert(response.status);
});
</script>
</html>
各个状态码的参考:http://tools.jb51.net/table/http_status_code
之后学习一下fetch的相关知识
原文地址:https://www.cnblogs.com/muyi-one/p/11379374.html
时间: 2024-10-10 15:04:32