I am building a SP hosted app in Office 365. The app is to get current weather, I am using api but it returns nothing. I have tried with the same code in ASP.Net Web Application and it worked. Why is it not working in SP hosted app? As I said it return nothing. Thx!

my code:

$(document).ready(function () {
            $.get("http://api.openweathermap.org/data/2.5/weather?q=Stockholm&APPID=23aabf5e2289b606d18f670397dcf3cb&units=imperial", function (response) {

<div id="name"></div>
        <br /> 
        <div id="temp"></div>
         <br /> 
        <div id="humidity"></div>

Most likely this is because you are making an http request on an https site, this is a security issue and browsers will block it. Check to see if they offer the api over https and use that instead.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.