Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Nithin B Chandran
@beingnin
i tried almost everything. tried to return the value using a function and store the var with that return value. but no use
Marianissimus
@Marianissimus
@beingnin global values will not work, since it's a asynchronouscall (updated in real time). Guys, can you elaborate on this?
Vincent D'Onofrio
@donofriov
nesting your calls is a good way to go
Nithin B Chandran
@beingnin
@Marianissimus my code here:

var loc = getCity();

    /*The API don't work in https*/
    $(document).ready(
    function () {            

        console.log('http://api.openweathermap.org/data/2.5/weather?q=' + loc + '&APPID=a9d7d3831db421de7c057c04e495dd4f');
        $.ajax({

            type: 'GET',
            url: 'http://api.openweathermap.org/data/2.5/weather?q=' + loc + '&APPID=a9d7d3831db421de7c057c04e495dd4f',
            success: function (data) {

                $('#desc').html(data.weather[0].description);
                $('#temp').html(data.main.temp);
            }

        });
    })

/Get current city/
function getCity() {
var x = '';
$.ajax({
type: 'GET',
url: ('http://freegeoip.net/json/'),
success: function (data) {
x=data.city;

            }
        });
    return x;
    }
Vincent D'Onofrio
@donofriov
so .getJSON(locator url, function(json) { some code .getJSON(weather url, function(json2){ )
if you click on this http://freegeoip.net/json/
do you see a city in the data?
Nithin B Chandran
@beingnin
@donofriov thanks for the idea. lemme try.
CamperBot
@camperbot
beingnin sends brownie points to @donofriov :sparkles: :thumbsup: :sparkles:
:cookie: 291 | @donofriov |http://www.freecodecamp.com/donofriov
Vincent D'Onofrio
@donofriov
@beingnin your code looks pretty good, it might be a data issue
well i mean for the second appi call at least
you should be getting your lat / lon first using your geo api call
then you can get city as well as all the other info you need from the weather api
Nithin B Chandran
@beingnin
@donofriov k
Josh
@joshfilippi

could anyone help me center my tick-tac-toe board? I've explored all the options I know of and found no solutions googling the problem.

https://codepen.io/JoshFilippi/pen/EZBQvQ

When opened on a bigger screen it isn't centered
kirbyedy
@kirbyedy
@joshfilippi that might be related with your bootstrap library
instead of that 4.0 which is in the alpha stage
Josh
@joshfilippi
@kirbyedy Thanks, but still not centered
CamperBot
@camperbot
joshfilippi sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1828 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Nithin B Chandran
@beingnin
@beingnin thanks a lot. it worked. one more thing.. how can we then store a json data to use in some other functions in cases such that we cannot use nested functions??
Anemnesea
@Anemnesea
Hello, Can someone please help me out with my code? I can't seem to get the Find local news <div> to float to the right.
Zhu Wei
@zhuwei12
I'm stuck in buliding a random quote machine...My question is ,how can I find a json in a html?or I need to make one by myself?
if then,how to make a json and put it into the website?
how can i use it?
I don't understand....
kirbyedy
@kirbyedy
@zhuwei12 it is up to you, you can either create an array of quotes on your own, and place it inside your javascript section
or make a json file and host it somewhere
or you can use an quote api that will give you access to random quotes
there is many around, search the internet
one of the populars are forismatic and quotes on design
Zhu Wei
@zhuwei12
So I can find one quote api in the internet
Dany Din
@danydin
@Anemnesea i suggest in small screen to use hambruger navbar to collapse it and then show it as a dropdown nav-menu
Nithin B Chandran
@beingnin
@zhuwei12 you can start with this:
var qoutes={object:{qoute: Its easy to code,author:God},
{qoute: Its not easy to code,author:Me}}
Zhu Wei
@zhuwei12
then can I use the getJSON function to use it? @beingnin
Dany Din
@danydin
no @zhuwei12
in that case u use for loop to itetrate through all the objects and display them
siaka tayou karl william
@theabstact237

@theabstact237
Hello world
right now im having problem to slide my carousel's images
please need some helps
here is the code
<section class="container">

<header class="row">
<div class="col-md-12 col-col">
<div id="b" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="b" data-slide-to="0" class="active"></li>
<li data-target="b" data-slide-to="1" ></li>
<li data-target="b" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active ">
<img src="karl.jpg" style="width:700px;height:600px" >
</div>
<div class="item ">
<img src="sandra.jpg" >
</div>
<div class="item ">
<img src="crowd.jpg" >
</div>

</div>
</div>
<a class="left carousel-control" href="#b" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#b" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>


</header>

</section>

Dany Din
@danydin
share codepen ^
siaka tayou karl william
@theabstact237
hello?!
Can someone help me ?
tareq4
@tareq4
He said share it from codepen
@theabstact237
siaka tayou karl william
@theabstact237
oooohhh thank you! @tareq4 and @danydin