Stuck on Local Weather project

Project Link -
I don’t understand why my city isn’t showing up on my list.

You define var api before you give lat and long a value.

So, use this:

    var lat =;
    var long = data2.lon;
    var api = ''+lat+'&lon='+long+'&appid=617c70da1e9d92ef037ce2a629638af3';

Instead of:

    var lat;
    var long;
    var api = ''+lat+'&lon='+long+'&appid=617c70da1e9d92ef037ce2a629638af3';
    lat =;
    long = data2.lon;
1 Like

thanks for quick reply, working now. :grin:
Follow up question: so does it goes in order from top to bottom? because i didn’t define lat and long (which is in my api) before api registered?(don’t know correct term)

You mean that you didn’t state something like var lat; before your $.getJSON(ip-api..)?

nvm forget what i said =P