<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>解决回调地狱</title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
<script>
window.onload = function() {
$.ajax({
type:'GET',
url:'./data1.json',
dataType:'jsonp',
success:function(res){
const {id} = res
console.log(res)
}
})}
</script>
</head>
<body>
</body>
</html>
为什么我使用了jsonp请求谷歌浏览器还是报错
但是edge却可以正常发起请求收到结果呢?