Alle meine Apps mit AJAX-Anfragen sind Rückkehr Fehler: Diese Anfrage wurde blockiert; Der Inhalt muss über HTTPS bereitgestellt werden. Zum Beispiel: https://zzharuk.github.io/local_weather_widget/github.io blockiert ajax Anfrage
function getWeather(location, value, callback) {
var url = "http://api.openweathermap.org/data/2.5/weather";
$.ajax({
dataType: "jsonp",
url: url,
jsonCallback: 'jsonp',
data: {
appid:"3556435b983a95646ad9cab4a5ee0943",
units: value,
lat:location.latitude,
lon:location.longitude
},
cache: false,
success: function (data) {
callback(data);
}
});
}
function LocalWeather() {
$.ajax({
url: '//freegeoip.net/json/',
type: 'GET',
dataType: 'jsonp',
success: function (location) {
getWeather(location,"metric",function (data) {
console.log(location);
console.log(data);
})
}
})
}
Änderung 'http: /' auf 'https: /' – madalinivascu
Ich habe das am Anfang, aber: net :: –
ERR_CONNECTION_REFUSED https://zzharuk.github.io/local_weather_widget/index.html 404 wurde nicht gefunden! –