我正在尝试从此 url 获取 json 字符串:http: //status.mojang.com/check
但是每次我失败或这样:
XMLHttpRequest cannot load http://status.mojang.com/check. Origin null is not allowed by Access-Control-Allow-Origin.
任何帮助表示赞赏
<!DOCTYPE html> <html> <head> <title>mc stats</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script> <meta http-equiv="Access-Control-Allow-Origin" content="*"> </head> <body>
<div id="minecraft"> </div>
<script> (function() { var flickerAPI = "http://status.mojang.com/check?jsoncallback=?"; $.getJSON(flickerAPI)
.done(function( data ) {
console.log(data); }); })(); </script> </body> </html>