<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>test</title>
<meta name="description" content="test">
<meta name="author" content="test">
<!--Google's CDC for jQuery.-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="show.js"></script>
</head>
<body>
</body>
</html>
$(document).ready(function() {
$.getJSON('http://status.leagueoflegends.com/shards?api_key=secretcode', function(data) {
alert(JSON.stringify(data));
});
});
当我尝试提醒这一点。只是提醒JSON数据
https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/RiotSchmick?api_key=secretcode
它的工作原理。
但是这个。 http://status.leagueoflegends.com/shards?api_key=secretcode
不起作用。
PS。秘密代码是他们给我们的API密钥。
直接请求浏览器上的网址以知道哪里出了问题。 – mithunsatheesh 2014-10-07 06:29:56
查看您的控制台是否有错误。您的网站是否运行HTTPS? – Spokey 2014-10-07 06:30:48
您可能会收到错误并且不会调用成功处理程序。添加一个错误处理程序到您的请求。 – Krease 2014-10-07 06:31:34