Undefined variable in local weather app

Here I seem to be getting a undefined variable error for the variable outside1 and outside21.Cant seem why this would be the case as I declare it in a global.
As var outside; and var outside21;.

Where is the data variable created?

Instead of globally, what if you declared your two variables locally like this:
var outside1 = data.name;
var outside21 = data.main.temp;

Would that solve the issue you are having?

I already have

this is the first bit of the code

the first picture was the second bit of the code.

and this is the third bit.

as you can see its declared at the top…and asigned in the in the function and the variable needs to be used in another function as well.