为预测天空设置 XMLHttpRequest API

Setting up an XMLHttpRequest for Predict the Sky API

The API in question is this one。我无法理解 XMLHttpRequest 网址所需的格式。我觉得是这样的:

var url = "http://api.predictthesky.org/?application/json?events/all?lat=0?lon=0";

但我收到此错误:"net::ERR_NAME_NOT_RESOLVED"

问题可能不在 link。这是设计总监 Glen Murphy 先生的解释,Google Chrome。

This is a pretty generic error that can be caused by a wide range of things. The most common cause can be fixed by unchecking 'automatically detect proxy settings' in your computer's network settings .(Chrome settings > Under the hood > Change proxy settings > LAN Settings).

You can try manually entering a DNS server IP address in your computer's network settings, though that's a little more complicated.

如果它不起作用,您可以在这里查看更多解决方案

http://www.quora.com/How-can-I-fix-Error-105-net-ERR_NAME_NOT_RESOLVED-The-server-could-not-be-found-on-Chrome

主机名 api.predictthesky.org 似乎没有解析。它至少从 4 月开始就消失了(参见 this 之类的论坛帖子或带有 #predictthesky 的推文)。

您可以尝试联系与 their github repo 相关的人之一,看看他们是否可以解决问题。