the code is as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ajaxjson</title>
<script type="text/javascript" src="jquery-3.3.1.js"></script>
</head>
<body>
<button id="btn">ajax</button>
<script type="text/javascript">
$("-sharpbtn").click(function() {
$.ajax({
type : "get",
async: false,
url : "http://yunxtec.com/test/adlist.json",
dataType: "jsonp",
jsonp:"callback",
success : function(data) {
alert(data[0][1]);
},
error : function(r) {
alert("fail");
}
});
})
</script>
</body>
</html>
Screenshot of error message is as follows:
GET200:
json:
what is the problem? How do I write if I want to get the index of adlist? Paste the code ~ ~
if you canthe problem has perplexed me as a rookie for a long time. Ask for help!