These are chat archives for FreeCodeCamp/HelpFrontEnd

18th
Feb 2016
Sujit Karki
@Swoozeki
Feb 18 2016 00:00
I think you can pop that in the education section
or if you've earned a certificate already, put that under achievements section
@caleb272 Right. So, I'm working on to the non-profit projects
that's some 500 hours away though :|
Caleb Martin
@caleb272
Feb 18 2016 00:03
ya i just finished the tribute thing so its so far away for me too
Sujit Karki
@Swoozeki
Feb 18 2016 00:04
We're all gonna make it :D
Preston Porter
@code7777
Feb 18 2016 00:04
can someone help me figure out why when I press clear it dosn't clear the text
??
Sujit Karki
@Swoozeki
Feb 18 2016 00:04
@code7777 post the snippet^
check out the javascript
Sujit Karki
@Swoozeki
Feb 18 2016 00:05
you don't have a Screen. You do have a screen
Preston Porter
@code7777
Feb 18 2016 00:06
??
Sujit Karki
@Swoozeki
Feb 18 2016 00:07
$("#Screen").text(" ");
You don't have an id "Screen" in your html
greg
@wearenotgroot
Feb 18 2016 00:08
@code7777 syntax error
@code7777 it's .click
@code7777 not onclick
Sujit Karki
@Swoozeki
Feb 18 2016 00:09
nvm, follow his instruction^ haha. You do have "Screen"
greg
@wearenotgroot
Feb 18 2016 00:09
@code7777 something like
$("#C").click(function(){clearScreen();});
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:12
hey guys! is parseInt() the best way of converting a string to number? skeptical of using it cos of its limitations
Caleb Martin
@caleb272
Feb 18 2016 00:12
cant you just cast it or is that not in JS
Preston Porter
@code7777
Feb 18 2016 00:14

@wearenotgroot this is what i have
```$( document ).ready(function() {
console.log( "ready!" );

$("C").click(function(){clearScreen();});

function clearScreen(){
$("#screen").text(" ");
}
});
```

$( document ).ready(function() {
    console.log( "ready!" );

  $("C").click(function(){clearScreen();});

  function clearScreen(){
    $("#screen").text(" ");
  }
});
good observations guys im still having trouble tho
greg
@wearenotgroot
Feb 18 2016 00:15
@code7777 put a # on C
@code7777 C is an id remember
Preston Porter
@code7777
Feb 18 2016 00:16
ohhhhh
greg
@wearenotgroot
Feb 18 2016 00:16
@Lumexralph have you tried using Number()<---------------------wrapper
Preston Porter
@code7777
Feb 18 2016 00:16
sweeeeeettttt i got that part to work thanks man!!!! @wearenotgroot
greg
@wearenotgroot
Feb 18 2016 00:17
@code7777 YW
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:18
not yet @wearenotgroot
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:18
was trying to be sure, would look that up and tell you if am cool with that method
thanks man @wearenotgroot
CamperBot
@camperbot
Feb 18 2016 00:18
lumexralph sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
greg
@wearenotgroot
Feb 18 2016 00:19
@Lumexralph what are you trying to do anyways?
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:20
working on pomodoro timer
greg
@wearenotgroot
Feb 18 2016 00:20
@Lumexralph oh ok
@Lumexralph formatting?
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:21
want to get a value from dom which is a string, then want to convert it to a number to be able to perform some operations on it
greg
@wearenotgroot
Feb 18 2016 00:21
@Lumexralph yeah use Number()
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:22
okay, thanks again
greg
@wearenotgroot
Feb 18 2016 00:22
@Lumexralph however the js interpreter will most likely convert that string into number if it can
@Lumexralph if it cannot it will give you NaN
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:23
will look it up
greg
@wearenotgroot
Feb 18 2016 00:23
@Lumexralph so if you have like '1' * 2<--------------------it will try to do the operation even if 1 is a string
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:24
yeah, i understand that
greg
@wearenotgroot
Feb 18 2016 00:25
alrighty then, GL
Ogundele Olumide
@Lumexralph
Feb 18 2016 00:26
on what grounds will Number() return NaN value?
Preston Porter
@code7777
Feb 18 2016 00:34
how do you modify a span element in jquery/javascript??
Alvis Ng
@vizFlux
Feb 18 2016 00:47
@dickfink Thanks for the spots, could you elaborate more on this?
CamperBot
@camperbot
Feb 18 2016 00:47
vizflux sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 171 | @dickfink | http://www.freecodecamp.com/dickfink
Joshua Abu
@Absolutestunna
Feb 18 2016 00:51
Is there anyone who has worked on the calculator that can help me complete my project? I have the html, css and js calculation between two numbers finished but I need help in calculating more than two numbers
Casey Heath
@ExhibitArts
Feb 18 2016 00:55
This message was deleted
Dick Fink
@dickfink
Feb 18 2016 00:56

@vizFlux

function countdownCtrl() {
    if (seconds === 0) {
        minutes--;
        seconds = 59;
    } else {
        seconds--;
    }
    // Executing timeCount();
    (function timeCount() {
        if (minutes === 0 && seconds === 0) {
            clearInterval(interval);
            if (break_length) {
                breakInterval = setInterval(breakcountCtrl, 1000);
            }
        } else {
            $('#total').html(minutes + ":" + (seconds < 10 ? "0" : "") + String(seconds));
        }
    })();
}

If seconds === 0 when you call countdownCtrl(), then it will set seconds to 59. This means that you never fulfil the “if (muntes === 0 && seconds == 0)” statement in the timecount() function….

Casey Heath
@ExhibitArts
Feb 18 2016 00:56
This message was deleted
I'm not sure why the "News" link on the bottom nav moves to the left and out of view when I resize my browser window. Can someone help please? - http://codepen.io/ExhibitArts/pen/obOaax?editors=1100
Liz
@erbastian
Feb 18 2016 01:11
I'm working on the "build a personal portfolio webpage" challenge, and i just need some guidance. Where would I find information about having multiple background images so that it looks like it does on the example website... you scroll and you see the different pictures. Im not having much luck with google.
Larry Simiyu
@LarrySimiyu
Feb 18 2016 01:11
Someone willing to answer a quick question about for loops?
Bruce Young
@mutantspore
Feb 18 2016 01:11
@erbastian DIVs can have background images
Liz
@erbastian
Feb 18 2016 01:11
thanks @mutantspore
CamperBot
@camperbot
Feb 18 2016 01:11
erbastian sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1143 | @mutantspore | http://www.freecodecamp.com/mutantspore
Lewis
@Lewis65
Feb 18 2016 01:14
Anyone got any idea why my 'Favourite' tab on the Twitch API project is displaying a seemingly random number (between 1 and 4) of panels? Everything is contained in a success function of the getJSON call and I can't figure out why it's not properly iterating through the favChannels array. http://codepen.io/Lewis65/full/yeqdLE/
greg
@wearenotgroot
Feb 18 2016 01:20
@Lewis65 have your variable on the top
Dick Fink
@dickfink
Feb 18 2016 01:20
@LarrySimiyu what’s up — i can try to hep
Sloth
@RMo-Sloth
Feb 18 2016 01:21
@erbastian I also think the example website uses jQuery to change the static backgrounds.
greg
@wearenotgroot
Feb 18 2016 01:21
@Lewis65 and remember /streams only returns channels that are streaming
@Lewis65 if you want to get info about a channel even thought they are not streaming you need to use /channel, and need to do it one by one
Luis Felipe López G.
@luishendrix92
Feb 18 2016 01:23
wot wot there are FCC stickers now, 2x5 bucks
but who ships 'em?
Larry Simiyu
@LarrySimiyu
Feb 18 2016 01:25
@dickfink Okay so Im working on a c++ program. we ask the user to enter the lowest value and the highest value, so lets say highest 43 lowest 23, One thing the teacher does it increment by 5, which I know how to do.. but the teacher also manages to start the chart from 25 and end at 45. So basically he is able to make the chart divisible by 5. I dont know how I would manage to do that.
Dick Fink
@dickfink
Feb 18 2016 01:27
Larry, i dont know any c++, but maybe this stack exchange link can help you out: http://stackoverflow.com/questions/3407012/c-rounding-up-to-the-nearest-multiple-of-a-number
Larry Simiyu
@LarrySimiyu
Feb 18 2016 01:27
@dickfink forgot to mention your answer didnt have to be in c++ was just looking to be led in the right direction
Dick Fink
@dickfink
Feb 18 2016 01:28
ah
@LarrySimiyu well i would create a roundUp method and roundDown method, check the last digit of the input and call the appropriate function
int RoundUp(int toRound)
{
     return (10 - toRound % 10) + toRound;
}

int RoundDown(int toRound)
{
    return toRound - toRound % 10;
}
Jean-Hubert
@teskar
Feb 18 2016 01:42
I accidentally submitted my tribute link instead of my portfolio link. Resubmitting doesn't seem to work. '
Sebastian
@interstellaridea
Feb 18 2016 01:53
hi everyone! im reaching out to anyone who has finished the quote generator zipline... i cant seem to get the post as a tweet feature working....
not sure if im targeting the quote right.... its also been tricky on finding documentation on how to implement Twitter intent
Joshua Briley
@somecallmejosh
Feb 18 2016 01:54
kiel barry
@kielbarry
Feb 18 2016 01:59
can someone look at a jsfiddle of mine?
trying to get products to display side by side using boostrap
Paulo Soares
@paulosoaresf
Feb 18 2016 02:03
Hi everyone! I'm a newbie on front-end-development. Is there any css classes reference of bootstrap? Like a list. Tks!
Alvis Ng
@vizFlux
Feb 18 2016 02:04
@dickfink Thank you very much on the pointer, it seems I need to rethink this flow
CamperBot
@camperbot
Feb 18 2016 02:04
vizflux sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 175 | @dickfink | http://www.freecodecamp.com/dickfink
greg
@wearenotgroot
Feb 18 2016 02:07
@interstellaridea you are targeting the wrong thing
@interstellaridea should be tweet id not text
Sebastian
@interstellaridea
Feb 18 2016 02:08
hm
how would i target that?
(looking through twitters documentation for something)
greg
@wearenotgroot
Feb 18 2016 02:09
@interstellaridea oh sorry thought i saw text :smile:
Sebastian
@interstellaridea
Feb 18 2016 02:10
oh right yea in my sendTweet function?
so targeting the $("#tweet") should grab it... but the pop up do not seen to populate anything...
Sebastian
@interstellaridea
Feb 18 2016 02:18
look like it might be the call to encodeURIComponent
greg
@wearenotgroot
Feb 18 2016 02:18
@interstellaridea here
$(document).ready(function() {
/* resources i leaned from:
  http://www.sitepoint.com/use-jquerys-ajax-function/

 */

//global Variables
$("#generate").on('click', getQuote);
$("#tweet").on('click',sendTweet);
var quote = "";
var author = "";

function getQuote(){
  $.ajax({
    //url to andrux quotes
    url: "https://andruxnet-random-famous-quotes.p.mashape.com/cat=famous?callback?",
    //object sending a key through the headers
    headers: {
      'X-Mashape-Key': 'SJFL2vk9l3msh8V2MTNx5OJOfY8Cp169i0Yjsn2XteSoDyqWH9'
    },
    success: function(data) {
      //grab quote obj
      var quoteObj = JSON.parse(data);
      //grab quote
      quote = quoteObj.quote;
      //grab author
      author = quoteObj.author;      

      //Target text for quote
      $('#text').html(quote);      
      //Target author for quote author and animate
      $("#author").animate({
        opacity: 0
      }, 500,
      function() {
        $(this).animate({
          opacity: 1
        }, 500);
        $('#author').html(author);
      });      
    }//end of success object    
  });//end of ajax function
}//end getQuote

function sendTweet() {
  //tweet vars
  var maxTweet = 140;
  var truncated = '';
  var hash = "#quote";
  var tweetLength = quote.length + author.length + hash.length; 

  //Truncate tweet if quote if over 140 chars
  if(tweetLength > maxTweet){
      truncated = quote.slice(0, maxTweet - author.length - 6 - hashtag);
      $("#tweet").attr('href', "https://twitter.com/intent/tweet?text=" + truncated + " " + author + hash);
    } else {
     console.log('ok ' + quote);
      $("#tweet").attr('href', "https://twitter.com/intent/tweet?text=" + quote + " " + author + hash);
    }
}//end of sendTweet


});
the problem was the scope of the varible
@interstellaridea you created function parameter with the same name as quote and author
@interstellaridea so inside the sendTweet function it only look at that parameters but you didnt send any parameters to it
@interstellaridea so it only saw blank
@interstellaridea the solution is to just remove those parameters in the sendTweet function because you already have the variables you need
Sebastian
@interstellaridea
Feb 18 2016 02:21
so sendTweet wasnt seeing the quote and author that the getQuote function created
greg
@wearenotgroot
Feb 18 2016 02:21
@interstellaridea yep because of it's on parameter(they have the same name)
Sebastian
@interstellaridea
Feb 18 2016 02:22
ha! dang good call!
thanks!!
i see that you also added everything in the $(document).ready too
greg
@wearenotgroot
Feb 18 2016 02:22
@interstellaridea yeah that too
@interstellaridea just too avoid having globals
Sebastian
@interstellaridea
Feb 18 2016 02:23
got it. just wasnt necessary to have?
greg
@wearenotgroot
Feb 18 2016 02:24
@interstellaridea yep you can drop it but remember scope of the function will be different
Sebastian
@interstellaridea
Feb 18 2016 02:26
cool that does help thanks
greg
@wearenotgroot
Feb 18 2016 02:26
@interstellaridea i guess you can do this
/* resources i leaned from:
  http://www.sitepoint.com/use-jquerys-ajax-function/

 */

//global Variables

var quote = "";
var author = "";

function getQuote(){
  $.ajax({
    //url to andrux quotes
    url: "https://andruxnet-random-famous-quotes.p.mashape.com/cat=famous?callback?",
    //object sending a key through the headers
    headers: {
      'X-Mashape-Key': 'SJFL2vk9l3msh8V2MTNx5OJOfY8Cp169i0Yjsn2XteSoDyqWH9'
    },
    success: function(data) {
      //grab quote obj
      var quoteObj = JSON.parse(data);
      //grab quote
      quote = quoteObj.quote;
      //grab author
      author = quoteObj.author;      

      //Target text for quote
      $('#text').html(quote);      
      //Target author for quote author and animate
      $("#author").animate({
        opacity: 0
      }, 500,
      function() {
        $(this).animate({
          opacity: 1
        }, 500);
        $('#author').html(author);
      });      
    }//end of success object    
  });//end of ajax function
}//end getQuote

function sendTweet() {
  //tweet vars
  var maxTweet = 140;
  var truncated = '';
  var hash = "#quote";
  var tweetLength = quote.length + author.length + hash.length; 

  //Truncate tweet if quote if over 140 chars
  if(tweetLength > maxTweet){
      truncated = quote.slice(0, maxTweet - author.length - 6 - hashtag);
      $("#tweet").attr('href', "https://twitter.com/intent/tweet?text=" + encodeURIComponent(truncated + " " + author + hash));
    } else {
      $("#tweet").attr('href', "https://twitter.com/intent/tweet?text=" + encodeURIComponent(quote + " " + author + hash));
    }
}//end of sendTweet

$(document).ready(function() {
  $("#generate").on('click', getQuote);
  //$("#tweet").on('click', sendTweet);

  //test
  $("#tweet").on('click', function() {
    $("#tweet").attr('href', "https://twitter.com/intent/tweet?text=" + encodeURIComponent(quote));
  });


});
@interstellaridea just remove the parameters
@interstellaridea YW
Sebastian
@interstellaridea
Feb 18 2016 02:27
yea thats more the look i was going for i guess.
just like clean .on('click', ) calls
greg
@wearenotgroot
Feb 18 2016 02:31
@interstellaridea just replace that anonymous function with sendTweet
@interstellaridea it should be squecky clean :smile:
Sebastian
@interstellaridea
Feb 18 2016 02:33
yea i took $("#tweet").on('click', sendTweet); back out from being commented
got my hashtag in ;0
$("#tweet").on('click', sendTweet);
greg
@wearenotgroot
Feb 18 2016 02:34
:+1:
Sebastian
@interstellaridea
Feb 18 2016 02:37
oh yay... the weather app...
lol
Michael Aubrey
@mca62511
Feb 18 2016 02:45

Working on the weather app

http://codepen.io/mca62511/pen/qbwQOa

The URL I generate, when used in the browser, shows the JSON information that I need.

However I can't get any of the information to show through console.log, so I think something about my &.getJSON must be messed up

Ignore what it actually displays for now, it is just a placeholder. I'm looking at the JavaScript/console
Sujit Karki
@Swoozeki
Feb 18 2016 02:46
$("#unit").click(function(){
        if(unit==="celcius"){
          $("#temperature").html(fahrenheit+"<button id='unit'>°F</button>");
          unit="fahrenheit";
        }
        else{
          $("#temperature").html(fahrenheit+"<button id='unit'>°C</button>");
          unit="celcius";
        }
      });
I can't seem to be able to switch back and forth. Please help!
Craig Banach
@CraigBanach
Feb 18 2016 02:46
@mca62511 Yea, getJSON doesn't work for this because of the API, it needs data to be sent along with the request to let either the browser or wikipedia to know that the request is geniune. I ended up using $.ajax
greg
@wearenotgroot
Feb 18 2016 02:47
@mca62511 never use Math.round or Math.floor on the lat and lon
@mca62511 otherwise it will be inaccurate
Sujit Karki
@Swoozeki
Feb 18 2016 02:47
@cragsify $.getJSON does work
Craig Banach
@CraigBanach
Feb 18 2016 02:48
@Swoozeki ok, can you share your getJSON code, i struggled with it for hours
greg
@wearenotgroot
Feb 18 2016 02:49
@mca62511
var apiKey = "7271d3292aac8f43062a11e66a3aa1b0";
var baseOpenWeatherUrl = "http://api.openweathermap.org/data/2.5/weather";
var apiOpenWeatherUrl = "";
$("document").ready(function() {
  // construct url based on location 
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      apiOpenWeatherUrl = baseOpenWeatherUrl + "?lat=" + position.coords.latitude + "&lon=" + position.coords.longitude + "&APPID=" + apiKey;
      console.log(apiOpenWeatherUrl)
       $.getJSON(apiOpenWeatherUrl, function(json) {
          console.log(json);
        });
    });
  }


});
@mca62511 ther reason it didnt work was remember the the geolocate is async
@mca62511 meaning your programming will not wait for it to finish before executing the code below it
dposse
@dposse
Feb 18 2016 02:50
@wearenotgroot do you just do math to convert from kelvin?
greg
@wearenotgroot
Feb 18 2016 02:50
@dposse set the units to imperial or metric on the url
@dposse &units=metric or imperial
dposse
@dposse
Feb 18 2016 02:51
right, i just dont see it in your code
Craig Banach
@CraigBanach
Feb 18 2016 02:51
@dposse You can also just convert, I did.
dposse
@dposse
Feb 18 2016 02:51
mine right now is grab imperial from api and convert to c manually
greg
@wearenotgroot
Feb 18 2016 02:52
@dposse mine is set to metric then just converted to imperial
Bruce Young
@mutantspore
Feb 18 2016 02:53
@mca62511 the issue is simply that the geolocation and getjson are asynchronous… they are processes that go off on their own and you don’t know when they will be back. So put the get json function inside the geolocation function OR wrap the getjson in a function and call it from within the geolocate … any use of the data returned will also need to be inside the getjson function or called from within it.
greg
@wearenotgroot
Feb 18 2016 02:54
@Swoozeki sorry bout the wrong mentioned
@mca62511 read my response ^
Sujit Karki
@Swoozeki
Feb 18 2016 02:54
Oh, no worries. I kept on reading into your response thinking why it was dedicated to me
greg
@wearenotgroot
Feb 18 2016 02:55
@Swoozeki used to pressing tab to cycle through things :smile:
Michael Aubrey
@mca62511
Feb 18 2016 02:56
@wearenotgroot Oh, I see. So by putting the .getJSON insie the other function it runs after it is done. Since I had it outside of it, it ran immediately without waiting for the navigator.geolocation.getCurrentPosition to finish running ... right?
greg
@wearenotgroot
Feb 18 2016 02:56
@mca62511 yep
Michael Aubrey
@mca62511
Feb 18 2016 02:56
@mutantspore Okay, so that makes sense now.
Craig Banach
@CraigBanach
Feb 18 2016 02:56
@mca62511 You can also use promises
Joseph
@HadziJo
Feb 18 2016 02:57
good catch @mca62511
Michael Aubrey
@mca62511
Feb 18 2016 02:58
Okay, I think 'm good now. Who to thank. Thank you @cragsify @wearenotgroot @mutantspore and @dposse
CamperBot
@camperbot
Feb 18 2016 02:58
mca62511 sends brownie points to @cragsify and @wearenotgroot and @mutantspore and @dposse :sparkles: :thumbsup: :sparkles:
:star: 1145 | @mutantspore | http://www.freecodecamp.com/mutantspore
:star: 284 | @dposse | http://www.freecodecamp.com/dposse
:star: 885 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
:star: 323 | @cragsify | http://www.freecodecamp.com/cragsify
Michael Aubrey
@mca62511
Feb 18 2016 02:58
Let me know if I forgot anyone
Joseph
@HadziJo
Feb 18 2016 02:58
@mca62511 do you have time for yet another question?
Michael Aubrey
@mca62511
Feb 18 2016 02:59
Oh, I think I was accidentally helpful. I wasn't answering a question, I was trying to figure out my own problem :P
but I'd be happy to answer if I know how... though others here are definitely more qualified
Tridev
@TridevGuha
Feb 18 2016 03:18
hi, I need a help, not relating to freecode camp project, but it needs javascript,html,css.
I have built a google map(with search function using google api), which will have a button,on clicking the button it will show me a list of facebook users based on the coordinate of the map.
How do I do that? please
Sujit Karki
@Swoozeki
Feb 18 2016 03:27

if I have a

$(".textDiv").html("<button id="unit">text</button>");

How can I retrieve the text inside of button element with "unit" id?

$(".textDiv").html("<button id='unit'>text</button>");
Karter
@Krter
Feb 18 2016 03:28
Hi guys I need a satisfactory answer for a question that frequently ppl ask me
Sujit Karki
@Swoozeki
Feb 18 2016 03:28
I tried, $("#unit").html which doesn't work
Craig Banach
@CraigBanach
Feb 18 2016 03:28
@Swoozeki $("#unit").val()
Karter
@Krter
Feb 18 2016 03:28
Why we need doctype ?
Craig Banach
@CraigBanach
Feb 18 2016 03:29
@Krter So the browser understand what it is reading.
Sujit Karki
@Swoozeki
Feb 18 2016 03:29
@cragsify Nope, returns undefined...
Craig Banach
@CraigBanach
Feb 18 2016 03:29
@Krter Browser will make assumption on what it is reading if there is no doctype, and therefore may get it wrong.
Karter
@Krter
Feb 18 2016 03:31
@cragsify I said this answer then they without that will it work ? If so then why we need it ? It makes me annoying
Craig Banach
@CraigBanach
Feb 18 2016 03:32
@Krter If you don't have it then 90% of time it will still work, but for unusual or old browsers, then it may break. Get the people that are asking you to try this on really old or really niche browsers.
h4r1m4u
@h4r1m4u
Feb 18 2016 03:32
@cragsify @Swoozeki val() is typically for inputs, selects, etc. i don't think it's going to work in this case. @Swoozeki try $("#unit").text() instead
Karter
@Krter
Feb 18 2016 03:34
@cragsify I have to say this to my interviewing stupiderz :+1:
@cragsify thanks for the help dude
CamperBot
@camperbot
Feb 18 2016 03:35
krter sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 324 | @cragsify | http://www.freecodecamp.com/cragsify
h4r1m4u
@h4r1m4u
Feb 18 2016 03:35
that's a great attitude to call people who interview you idiots. keep it up
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:36
All I have a question regarding the Wikipedia viewer project
Sujit Karki
@Swoozeki
Feb 18 2016 03:36
@h4r1m4u It worked! Mmmuah! Kisses and hugs
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:36
it’s about the right HTTP request I need to use for the MediaWiki API
h4r1m4u
@h4r1m4u
Feb 18 2016 03:36
@Swoozeki my pleasure!
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:36
if anyone is willing/able to help I would appreciate it!
Craig Banach
@CraigBanach
Feb 18 2016 03:37
@synflyn28 I can tell you what I did, I struggled to get $.get to work so ended up using $.ajax
Karter
@Krter
Feb 18 2016 03:38
@h4r1m4u @Swoozeki next time gonna give them some cookies and say EAT PRAY CODE but don't be in panel
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:38
@cragsify sure that would help, I actually had no problem with the API part (the JSONP callback is the trick for $getJSON(), FCC should’ve covered that in the previous lesson)
Craig Banach
@CraigBanach
Feb 18 2016 03:38
@synflyn28 Are you asking about the query type?
Karter
@Krter
Feb 18 2016 03:39
Hi ppl any jeet users here ?
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:39
@cragsify nope I actually know it’s search, but it’s what the search returns
Karter
@Krter
Feb 18 2016 03:40
I stuck with a problem in it
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:40
@cragsify specifically in the “snippet” attribute in the return string
Craig Banach
@CraigBanach
Feb 18 2016 03:40
@synflyn28 You can use the link from FCC to figure out what your json data looks like: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&titles=Main%20Page&prop=revisions&rvprop=content&format=jsonfm
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:41
@cragsify Oh I’ve already been there and the JSON structure isn’t the issue, but what’s actually stored in the snippet part
Craig Banach
@CraigBanach
Feb 18 2016 03:41
@synflyn28 Hmm, I'm not sure what you mean?
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:42
@cragsify here let me get a screen grab and I’ll show you
h4r1m4u
@h4r1m4u
Feb 18 2016 03:42
@synflyn28 what exactly is your question? and is there any code that we could have a look at and help you with?
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:45
@h4r1m4u it’s hard to describe without seeing what I’m getting
Screen Shot 2016-02-17 at 10.44.56 PM.png
Here’s what I have the sentance summaries I’m getting in my response JSON are either all incomplete or are missing part way
I’m getting a valid response from Wikipedia’s API, but the actual sentances grabbed from the pages from it are either incomplete or add parts that shouldn’t be there
it’s a data content problem, and I think there must be a way to change this
I don't seem to have this problem.
Craig Banach
@CraigBanach
Feb 18 2016 03:49
@synflyn28 I use a different request to you, I use and opensearch.
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:49
Sorry for the roundabout explanation it’s just a yucky data problem
@cragsify thanks! I’ll check it out
CamperBot
@camperbot
Feb 18 2016 03:49
synflyn28 sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 325 | @cragsify | http://www.freecodecamp.com/cragsify
Craig Banach
@CraigBanach
Feb 18 2016 03:54
Hi guys, how do I capture a failed $.getJSON event,
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:58
@cragsify thanks! That data structure looks like the one I’m looking for! Your request is correct
CamperBot
@camperbot
Feb 18 2016 03:58
synflyn28 sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:warning: synflyn28 already gave cragsify points
Justin Lynn Reid
@synflyn28
Feb 18 2016 03:58
@cragsify and for $.getJSON you have to switch over to $.AJAX in order to bind a function for failure
@cragsify $.getJSON is just a simplified form of $.AJAX
h4r1m4u
@h4r1m4u
Feb 18 2016 03:59
@synflyn28 i checked the request you're making using the wiki api sandbox and i dont' think there's a way to increase the length of the snippet
you'll need to adjust the request itself and use different parameters
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:00
@h4r1m4u thanks for heads up, and I found the right request from @cragsify
CamperBot
@camperbot
Feb 18 2016 04:00
synflyn28 sends brownie points to @h4r1m4u and @cragsify :sparkles: :thumbsup: :sparkles:
:warning: synflyn28 already gave cragsify points
:star: 1428 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 18 2016 04:00
@synflyn28 cool. great. if you want mine for comparison, here you go:
  var baseApiUrl = 'https://en.wikipedia.org/w/api.php?callback=?',
      getSearchTopicParams = {
        action: 'query',
        format: 'json',
        formatversion: 2,
        prop: 'pageimages|extracts|info', // return page images, extracts
        pilimit: 10, // how many page images to return
        exlimit: 10, // how many extracts to return
        exchars: 500, // extract is 500 characters long
        explaintext: "", // extract is plain text, not HTML
        exintro: "", // return only content before the first section. has to be present otherwise wikipedia complains the extract are too long
        inprop: 'url', // return page url
        generator: 'search',
        gsrnamespace: 0, // Seach '(Main)'
        gsrlimit: 10, // return 10 pages,
        gsrsearch: '', // the actual query to search, will be set when the function is called
      }
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:01
@h4r1m4u yeah the documentation for mediawiki is pretty hairy, it was actually harder for me to find the right request than to write the application itself
@h4r1m4u thanks again!
CamperBot
@camperbot
Feb 18 2016 04:02
synflyn28 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: synflyn28 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Feb 18 2016 04:02
@synflyn28 i agree. i struggled with the same problem. i did find the sandbox very helpful as it shows you the different options and you can immediately test what the request will return: https://en.wikipedia.org/wiki/Special%3aApiSandbox
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:03
@h4r1m4u I like that it included the sandbox and I did use it, though I prefer things like cURL because it doesn’t abstract certain things especially JSONP
@h4r1m4u I’m familiar with HTML request variables because I’ve worked with CGI before, but this API specifically had a lot of language and concepts specific to itself which made it harder
h4r1m4u
@h4r1m4u
Feb 18 2016 04:05
@synflyn28 i'm not sure i fully understand that. JSONP is just a way to get around the cross-domain request issue. the sandbox let's you test out the different parameters you can use when retrieving the data. seems like two different issues to me
one is a general technical problem, the other is just related to how the wiki API works specifically
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:07
@h4r1m4u Oh I know, now I’m just venting frustrations sorry about that!
h4r1m4u
@h4r1m4u
Feb 18 2016 04:07
@synflyn28 ah, ok, hahaha. yeah, the wiki api had me pulling my hair out too
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:09
@h4r1m4u oh definitely. Thanks again!
CamperBot
@camperbot
Feb 18 2016 04:09
synflyn28 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: synflyn28 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Feb 18 2016 04:09
@synflyn28 no wukkas!
Bruce Young
@mutantspore
Feb 18 2016 04:11
@h4r1m4u a touch of Australian there?
greg
@wearenotgroot
Feb 18 2016 04:11
@synflyn28 might want to add a check for property on data/result returned before displaying them or else you will get undefined
h4r1m4u
@h4r1m4u
Feb 18 2016 04:12
@mutantspore yeah, i've got a bunch of ozzie friends, picked it up from them :)
Bruce Young
@mutantspore
Feb 18 2016 04:12
:)
greg
@wearenotgroot
Feb 18 2016 04:12
@synflyn28 data.hasOwnProperty('page') or something
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:12
@wearenotgroot sure thing! I trust MediaWiki is pretty stable but you can’t be too careful about funky data
greg
@wearenotgroot
Feb 18 2016 04:14
@synflyn28 oh try data.hasOwnProperty('query')<--------first pages comes after
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:15
@wearenotgroot sure! That’s actually a good idea without having to tunnel through much cruft
@wearenotgroot though the new response that I’m getting is based on arrays, which is quirkier but nothing a few length checks won’t catch
greg
@wearenotgroot
Feb 18 2016 04:16
@synflyn28 oh well test the length then
Justin Lynn Reid
@synflyn28
Feb 18 2016 04:17
@wearenotgroot ha ha sure :)
Edison Brito
@edisonbrito
Feb 18 2016 04:20
hi guys
Lewis
@Lewis65
Feb 18 2016 04:20
@wearenotgroot I am doing it one by one, I think. I'm looping through the array of channels, calling the getJSON method for each one and appending them to the content div within the success function. But I will go through my code once again and check that this is the case, thanks.
CamperBot
@camperbot
Feb 18 2016 04:20
lewis65 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 886 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Brett Felts
@brettfelts
Feb 18 2016 04:20
I have a question on the wikipedia app. I'm returning:
XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=sle&utf8=true. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
any suggestions?
Lewis
@Lewis65
Feb 18 2016 04:21
@brettfelts add 'callback=?'
Brett Felts
@brettfelts
Feb 18 2016 04:23
MIME type not excutable
also, because it's $.ajax as opposed to $.getJSON, the callback is different
Lewis
@Lewis65
Feb 18 2016 04:24
ahh right - why not use getJSON?
Brett Felts
@brettfelts
Feb 18 2016 04:26
I actually was originally, but on the docs for the wikipedia api, it suggested adding headers as an argument on the request in order to fix my problem. That's only an option on $.ajax, not on getJSON
I'm actually not sure why
Lewis
@Lewis65
Feb 18 2016 04:26
hmm ok
Brett Felts
@brettfelts
Feb 18 2016 04:27
I could be wrong, I just can't figure it out
Lewis
@Lewis65
Feb 18 2016 04:27
To be honest, I actually moved on from the Wikipedia project before I got it working. I was having similar problems and the docs are pretty useless, or I'm just dumb. But I didn't feel like it was useful struggling, so I just moved on
Not really a solution, so maybe someone else can weigh in
Casey Heath
@ExhibitArts
Feb 18 2016 04:28
Anyone willing to work on a startup project with me? I need a few backend developers as well as a few front end programmers. Anyone who helps on the project will be compensated through the earnings from the website.
Brett Felts
@brettfelts
Feb 18 2016 04:28
I understand the sentiment actually
@ExhibitArts I'd be interested, but understand i'm still working through this
Casey Heath
@ExhibitArts
Feb 18 2016 04:30
@brettfelts What languages do you know and how familiar are you with them?
Brett Felts
@brettfelts
Feb 18 2016 04:32
HTML, CSS, JavaScript, jQuery. I'm ok with the latter two, and pretty decent with the former two.
you can check out my codepen if you like.
I've done a tiny bit of python also, but not enough to be helpful
What are the plans for the site?
h4r1m4u
@h4r1m4u
Feb 18 2016 04:34
@brettfelts adjust your ajax call to this:
  var wikiSearch = "https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=" + searchTerm +"&callback=?&format=json&utf8=";  
  $.ajax({
    url: wikiSearch,
    dataType: 'jsonp',
    success: function(data){
       console.log(data);
    // for (var j = 0; j < json[search].length; j++) {
    // $('window').append('<p>'+json[i]+'</p><br>');
    // }
  }
notice a) format=json is added into the URL, b) the type of the ajax call is remove (it's GET by default; you use GET for getting data from a server, POST to post data to), c) the done parameter is changed to success
check the console for what the returned object looks like and take it from there
Brett Felts
@brettfelts
Feb 18 2016 04:36
That's what I thought. I was thrown by copying the mediawiki's docs I guess
Thanks @Lewis65 and thanks @h4r1m4u
CamperBot
@camperbot
Feb 18 2016 04:37
brettfelts sends brownie points to @lewis65 and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 140 | @lewis65 | http://www.freecodecamp.com/lewis65
:star: 1429 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 18 2016 04:37
yw
Clark Arnold
@clarkarnold
Feb 18 2016 04:39
@brettfelts Did you just get started with the Wikipedia Viewer by reading the documentation on the links?
I am trying to get started and am very lost
Brett Felts
@brettfelts
Feb 18 2016 04:40
@clarkarnold I did.
Clark Arnold
@clarkarnold
Feb 18 2016 04:40
Ok cool thanks. Seems confusing
Brett Felts
@brettfelts
Feb 18 2016 04:40
It was confusing to say the least.
Clark Arnold
@clarkarnold
Feb 18 2016 04:41
Hah yeah I might try again tomorrow
Casey Heath
@ExhibitArts
Feb 18 2016 04:41
@brettfelts Are you in to work on the project with us?
Brett Felts
@brettfelts
Feb 18 2016 04:41
I would suggest structuring your call based on the jQuery $.getJSON or $.ajax calls
@ExhibitArts Yes.
Clark Arnold
@clarkarnold
Feb 18 2016 04:41
@brettfelts OK cool thank you
CamperBot
@camperbot
Feb 18 2016 04:41
clarkarnold sends brownie points to @brettfelts :sparkles: :thumbsup: :sparkles:
:star: 361 | @brettfelts | http://www.freecodecamp.com/brettfelts
h4r1m4u
@h4r1m4u
Feb 18 2016 04:42
@clarkarnold the sandbox is extremely helpful as it let's you test out the various parameters and options you can use when making the API calls: https://en.wikipedia.org/wiki/Special%3aApiSandbox
Matt Goldwater
@MJGwater
Feb 18 2016 04:42
hey. I was trying to further understand what the bootstrap class .form-control means. On this page http://v4-alpha.getbootstrap.com/components/forms/#form-controls it says additional documentation for .form-control is available, but I can't find anything. I'd appreciate any help finding documentation or advice for how to interpret the class in this situation
Brett Felts
@brettfelts
Feb 18 2016 04:42
@ExhibitArts Is it the site you have listed on under your profile picture?
@clarkarnold Glad I could help. @h4r1m4u helped me through, to be fair
Casey Heath
@ExhibitArts
Feb 18 2016 04:43
@brettfelts No. There is a description of it in the chat I added you to.
Brett Felts
@brettfelts
Feb 18 2016 04:43
@ExhibitArts Cool. I'll take a look
Clark Arnold
@clarkarnold
Feb 18 2016 04:45
@h4r1m4u I took a look at that but honestly wasn't sure what I was doing with it
lcthornhill
@lsrus
Feb 18 2016 04:52
Hi all, I'd be really grateful if anyone who's got a minute could click through onto my Weather App to test that they are getting a location, temperature and background image. Happy to do any testing in return. http://codepen.io/lsrus/full/MKRZLO/
Bruce Young
@mutantspore
Feb 18 2016 04:55
@lsrus right location and information. Is the flask meant to indicate science type answer (Kelvin)?? lol
lcthornhill
@lsrus
Feb 18 2016 04:56
@mutantspore - yes, I relate Kelvin directly to being bored in chemistry! Did you get a weather related background photo too? Thanks for looking
CamperBot
@camperbot
Feb 18 2016 04:56
lsrus sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1148 | @mutantspore | http://www.freecodecamp.com/mutantspore
greg
@wearenotgroot
Feb 18 2016 04:56
@lsrus looks good
Bruce Young
@mutantspore
Feb 18 2016 04:56
@lsrus perhaps the cursor should change to a finger to show that teh temp is clickable
lcthornhill
@lsrus
Feb 18 2016 04:57
thanks @wearenotgroot
CamperBot
@camperbot
Feb 18 2016 04:57
lsrus sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 887 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
Feb 18 2016 04:58
@lsrus btw do you own all the images? if not you need to site the source :smile: just for future reference
Bruce Young
@mutantspore
Feb 18 2016 04:58
yes it’s correct .. though it’s the wrong time of day but You haven’t gone that far. The icon number from OWM is a good source of that info rather than disecting the description
@lsrus a bit of miss allignment when you make the screen narrow, the text box goes up above the picture..
Karter
@Krter
Feb 18 2016 05:01
Hi ppl What is the use of meta tag there are different content inside that so what that exactly convay to the browser
Bruce Young
@mutantspore
Feb 18 2016 05:01
@lsrus if you look at this page http://openweathermap.org/weather-conditions you can see how the icon code could be used to index pictures
greg
@wearenotgroot
Feb 18 2016 05:02

@Krter Definition and Usage
Metadata is data (information) about data.

The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable.

Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.

The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.

lcthornhill
@lsrus
Feb 18 2016 05:04
@wearenotgroot the pictures are on a CCO license from Pexen, which if I've understood it properly, means they don't require attribution (though I agree it's good ettiquete so will modify to add some) https://www.pexels.com/photo-license/
Karter
@Krter
Feb 18 2016 05:04
So it take major role in search engine also @wearenotgroot ?..
greg
@wearenotgroot
Feb 18 2016 05:04
@lsrus :+1:
@Krter any data you not intend for user can be place on the tag(data that doesnt need to be secure)
lcthornhill
@lsrus
Feb 18 2016 05:06
@mutantspore @wearenotgroot - thanks for all the feedback, I'm going to make the changes now
CamperBot
@camperbot
Feb 18 2016 05:06
lsrus sends brownie points to @mutantspore and @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: lsrus already gave mutantspore points
:warning: lsrus already gave wearenotgroot points
Karter
@Krter
Feb 18 2016 05:11
Tx a lot @wearenotgroot :+1:
CamperBot
@camperbot
Feb 18 2016 05:11
krter sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 888 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
Feb 18 2016 05:11
@Krter np
@lsrus YW
Valeesi
@Valeesi
Feb 18 2016 05:20
Hi guys! I am stuck with trying to get the getElementIdBy(".text").innerHTML to work with my button. It doesn't seem to respond with the click event. My code: http://codepen.io/Valeesi/pen/ZQZOQE I am thankful for any help that I could get.
h4r1m4u
@h4r1m4u
Feb 18 2016 05:22
@Valeesi document.getElementById("text").innerHTML = "Test Quote";
DJ
@qualitymanifest
Feb 18 2016 05:25

@Valeesi yeah let me paste my comments from the /Help room here:

@Valeesi you've got getElementIdBy(".text") there's a few things wrong here. it needs to be preceeded by document, it's getElementById not getElementIdBy and it's "text" not ".text"
@Valeesi so document.getElementById("idGoesHere")
@Valeesi it's a little simpler with jQuery. $("#idGoesHere").text(variableGoesHere)

Valeesi
@Valeesi
Feb 18 2016 05:27
@qualitymanifest I read it first in the Help room. Been trying to fix it now. Thank you so much! Now it works with the document.xx but still working on trying to get it work with the jQuery solution.
CamperBot
@camperbot
Feb 18 2016 05:27
valeesi sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 973 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Feb 18 2016 05:28
@Valeesi you'll need to add jquery in, by clicking the gear button next to JS and adding it in the "add external javascript" section
Valeesi
@Valeesi
Feb 18 2016 05:35
@qualitymanifest Why does this function run without me even going through the "click event"? How do you suggest to put the jQuery line into the code?
function randomQuote() {
$('#text').text("Test Quote 123")
}
DJ
@qualitymanifest
Feb 18 2016 05:35
@Valeesi that runs regardless... you'll want to put that into a click function
basically you will replace the outer randomQuote function with a click function. and you'll have your random number variable inside your click function, so that it changes each time #text is clicked
Valeesi
@Valeesi
Feb 18 2016 05:38
@qualitymanifest Thank you again! I feel like there is quite a knowledge gap when I started to tackle the intermediate projects after the JS part. Haven't learned enough about jQuery or ajax. I would need to study more about them now.
CamperBot
@camperbot
Feb 18 2016 05:38
valeesi sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: valeesi already gave qualitymanifest points
Larry Simiyu
@LarrySimiyu
Feb 18 2016 06:12
hello need some quick help with something. making a list that has ten lines, but I need the user input to be rounded up and divisible by 5.. so say they enter 43 i need the list to start at 45.. does anyone have any idea of how I can manage this.
Dick Fink
@dickfink
Feb 18 2016 06:18
@LarrySimiyu , another way (assuming you’re always rounding up) — while(input % 5 !== 0){input += 1 } — once input % 5 === 0, make your list….
DJ
@qualitymanifest
Feb 18 2016 06:20
This message was deleted
This message was deleted
Brett Felts
@brettfelts
Feb 18 2016 06:37
This may seem an odd place for this, but I'm looking for front end developer to help out with a news site. any takers?
Pradeep CE
@cepradeep
Feb 18 2016 06:48
@brettfelts I'd love to help. If it's open-source / for an non-profit, I'll do it for free :)
Larry Simiyu
@LarrySimiyu
Feb 18 2016 06:48
@brettfelts ill help, I need something to work on for experience
Brett Felts
@brettfelts
Feb 18 2016 06:50
@LarrySimiyu and @pradeepce what kind of experience do you have?
Larry Simiyu
@LarrySimiyu
Feb 18 2016 06:50
@LarrySimiyu
im trying to make a table to convert gallons to liters, only problem is on the first line on the table that is when my solution works fine, but it keeps printing the same answers for the rest of the table.. so for example 5 = 10; 6 = 10; 7 = 10;
how can I solve it
this is for c++
kirbyedy
@kirbyedy
Feb 18 2016 06:51
@LarrySimiyu this is a front end help room, I dont think there is many people who are into c++
Larry Simiyu
@LarrySimiyu
Feb 18 2016 06:51
@brettfelts I have the im a fast learner and just want some experience while i get to learn lol
@kirbyedy I am aware but there are similarities, I can get the javascript answer and just tweek it to work in c++ not difficult
kirbyedy
@kirbyedy
Feb 18 2016 06:52
still... this is front end mate :)
try the javascript room then
Larry Simiyu
@LarrySimiyu
Feb 18 2016 06:53
not a big deal, some people hop around the chatrooms when asking questions, but already am thanks
bitgrower
@bitgrower
Feb 18 2016 06:54
@LarrySimiyu -- I think if you go on hackernews you might be able to find some IRC resources for c++ programmers ... might get a bit more help in one of those ... (or just google for c++ chats)
Pradeep CE
@cepradeep
Feb 18 2016 06:56
@brettfelts Not much, I'm just re-learning everything on FCC. Take a look - http://codepen.io/pradeepce/full/bEzyQO/
Larry Simiyu
@LarrySimiyu
Feb 18 2016 06:56
if anyone has a javascript solution to my question please let me know
Ankit Panwar
@coderNoob
Feb 18 2016 07:02
@pradeepce Cool designs you got there.
Pradeep CE
@cepradeep
Feb 18 2016 07:07
@coderNoob Thanks Ankit :) I'm learning the ropes
CamperBot
@camperbot
Feb 18 2016 07:07
pradeepce sends brownie points to @codernoob :sparkles: :thumbsup: :sparkles:
:star: 335 | @codernoob | http://www.freecodecamp.com/codernoob
Dulshani Gunawardhana
@dshgna
Feb 18 2016 07:14
@pradeepce beautiful work! Where did you get the face image from?
Pradeep CE
@cepradeep
Feb 18 2016 07:17
@dshgna Thanks :) I used this for the cartoon image - http://cartoonify.de/
CamperBot
@camperbot
Feb 18 2016 07:17
pradeepce sends brownie points to @dshgna :sparkles: :thumbsup: :sparkles:
:star: 149 | @dshgna | http://www.freecodecamp.com/dshgna
Dulshani Gunawardhana
@dshgna
Feb 18 2016 07:20
@pradeepce cool thanks! I'm going to try it out
CamperBot
@camperbot
Feb 18 2016 07:20
dshgna sends brownie points to @pradeepce :sparkles: :thumbsup: :sparkles:
:star: 346 | @pradeepce | http://www.freecodecamp.com/pradeepce
Pradeep CE
@cepradeep
Feb 18 2016 07:22
@dshgna Glad :)
Caleb Martin
@caleb272
Feb 18 2016 07:26
hello everyone
thomas-duval
@thomas-duval
Feb 18 2016 07:32

Hey guys,

I need help with the wikipedia API.
I generate a working url (checked in browser) but it doesn't work with getJSON :

$("#search").click(function searchWiki() {
    var keyword = $("#keyword").val();
    var wikiUrl = 'http://en.wikipedia.org/w/api.php?action=opensearch&format=json&limit=10&search=' + keyword;
    $.getJSON(wikiUrl, function (data) {
        $("#result").html(data);
    });
});

Any idea ?
Thanks in advance.

Michael Aubrey
@mca62511
Feb 18 2016 07:35
@thomas-duval can we see your codepen?
bitgrower
@bitgrower
Feb 18 2016 07:37
also @thomas-duval -- not sure if it will help or not, but I was reminded earlier today about the JSON/API challenges ... there might be some good stuff in there :)
kirbyedy
@kirbyedy
Feb 18 2016 07:38
@thomas-duval I think you are missing that callback
thomas-duval
@thomas-duval
Feb 18 2016 07:44

@mca62511 : http://codepen.io/thomasduval/pen/qbwvoj
@bitgrower : Didn't find anything useful
@kirbyedy : If I understand the way callback work, I would need to use this instead :

$("#search").click(function searchWiki() {
    var keyword = $("#keyword").val();
    var wikiUrl = 'http://en.wikipedia.org/w/api.php?action=opensearch&format=json&callback=data&limit=10&search=' + keyword;
    $.getJSON(wikiUrl, function (data) {
        $("#result").html(data);
    });
});

Right ?

kirbyedy
@kirbyedy
Feb 18 2016 07:45
I think it should be callback=?
bitgrower
@bitgrower
Feb 18 2016 07:45
you're hired, @thomas-duval
h4r1m4u
@h4r1m4u
Feb 18 2016 07:46
@thomas-duval you want this var wikiUrl = 'http://en.wikipedia.org/w/api.php?callback=?&action=opensearch&format=json&limit=10&search=' + keyword;
thomas-duval
@thomas-duval
Feb 18 2016 07:47
And we have 2 winners !
Thanks guys ;)
Ankit Panwar
@coderNoob
Feb 18 2016 07:52
The text doesn't feel like centered in this. I used text-align: center.
http://codepen.io/coderNoob/pen/vLmyWN?editors=1100
Karter
@Krter
Feb 18 2016 07:52
hi guys
any stylus users here ?..
Luu Nguyen
@nnluukhtn
Feb 18 2016 07:54
@coderNoob you can try this way: set line-height of .col-xs-3
Ankit Panwar
@coderNoob
Feb 18 2016 07:58
@nnluukhtn Didn't really make any difference
Also, it's google fonts, and I'm not able to change the font size
Luu Nguyen
@nnluukhtn
Feb 18 2016 08:05
@coderNoob cause it will append h1 into .col-xs-3
pls see at http://codepen.io/anon/pen/bEJZZP?editors=1100
Ankit Panwar
@coderNoob
Feb 18 2016 08:08
@nnluukhtn Thanks
CamperBot
@camperbot
Feb 18 2016 08:08
codernoob sends brownie points to @nnluukhtn :sparkles: :thumbsup: :sparkles:
:star: 8 | @nnluukhtn | http://www.freecodecamp.com/nnluukhtn
Luu Nguyen
@nnluukhtn
Feb 18 2016 08:09
welcome @coderNoob :)
Kietil
@Kietil
Feb 18 2016 08:12
For sites like http://www.lifeextension.com/ where it has different sections (a type of hub) with alot of editing and adding new things on a daily basis.. what type of technonology is used to build it and then what do users (authors mostly) add things with - without knowing code?
Dulshani Gunawardhana
@dshgna
Feb 18 2016 08:29
My wikipedia viewer...feedback needed :)
http://codepen.io/dshgna/full/NxmoPj/
Jan Pribošek
@GreatDanton
Feb 18 2016 08:31
@Sivilll you can check out builtwith.com
Kietil
@Kietil
Feb 18 2016 08:35
@GreatDanton Do you think it's as simple as Wordpress? Built by someone and edited by non-coding authors?
Harry Aydin
@HMAN1911
Feb 18 2016 08:40
@dshgna Simple and functional. Good work! :)
dseright
@dseright
Feb 18 2016 08:40
Hey guys. I'm working on the first project, the tribute page. And I'm trying to get some of my text in the right place. I know I can just pad it and get it exactly to where I want it but I was also thinking maybe I should look into the bootstrap aspect to make it more dynamic. Is that a good idea?
kirbyedy
@kirbyedy
Feb 18 2016 08:41
yes
Harry Aydin
@HMAN1911
Feb 18 2016 08:41
@dshgna Some suggestions. Add a loading bar for when waiting for results, set a limit for how wide the content is, and try to incorporate more of the api ;)
dseright
@dseright
Feb 18 2016 08:43
Okay. I guess I already knew that was the right answer it just made more sense once I had typed it out. Thanks @kirbyedy
CamperBot
@camperbot
Feb 18 2016 08:43
dseright sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 496 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Jan Pribošek
@GreatDanton
Feb 18 2016 09:11
@Sivilll yes it is. Most of the dynamic sites, online stores, etc... have the ability to update content, without diving into code.
h4r1m4u
@h4r1m4u
Feb 18 2016 09:19
@Sivilll @GreatDanton i'm pretty sure lifeextension.com doesn't run on wordpress. it looks to me like it's custom built from scratch, though i might be wrong. that said, there are open source CMSs that can be used to build sites that can be managed by non-coders. building a site as complex as lifeextension in wordpress would be a nightmare, though (if at all possible). @Sivilll i'd dare to venture that almost every site nowadays comes with some sort of a back-end that let's the users add and manage content. if you're looking for an e-commerce solution, for a small site wordpress + woocommerce would do, for large store you'll want a more sophisticated solution such as magento, for example.
Jan Pribošek
@GreatDanton
Feb 18 2016 09:20
he asked if it's made as simple as wordpress
h4r1m4u
@h4r1m4u
Feb 18 2016 09:20
and it's not
if he's talking about lifeextension.com
Jan Pribošek
@GreatDanton
Feb 18 2016 09:20
it's obvious not wordpress, but it's probably easy to add content
Dulshani Gunawardhana
@dshgna
Feb 18 2016 09:23
@HMAN1911 ah thanks
CamperBot
@camperbot
Feb 18 2016 09:23
dshgna sends brownie points to @hman1911 :sparkles: :thumbsup: :sparkles:
:star: 91 | @hman1911 | http://www.freecodecamp.com/hman1911
Dulshani Gunawardhana
@dshgna
Feb 18 2016 09:24
@HMAN1911 width of content as in amount in results?
Kietil
@Kietil
Feb 18 2016 09:30
@h4r1m4u interesting answer. Scenario: I want to built a site that sells watches and have a social media feed at the bottom where pictures that are tagged with #whateveriwant shows up there, and nothing else (these images are customers tagging the shop they bought a certain watch - the site i am talking about). I know little, but i would assume, building something like this is preferably done with WP, but if i want to go clear of it and choose something else.. what would be my option? The MEAN stack route? Meteor? would do you think @h4r1m4u ? - what i am seeking is mapping out the landscape of where one should look for certain things, so a general answer that would point me in the right direction would be of much appreciation.
h4r1m4u
@h4r1m4u
Feb 18 2016 09:31
@Sivilll how many products will there be in the store? how many product categories? how many orders do you expect each month on average?
Kietil
@Kietil
Feb 18 2016 09:34
@h4r1m4u i want to build it for a portofolio site, so if its looks and functions ok without the details - i am fine. Lets say 4 categories and 25 items in the store
Michael Martin
@MikeASNT
Feb 18 2016 09:36

Hey can anyone help me with a bit of a math issue? http://codepen.io/MikeASNT/pen/adxGoL?editors=0010

I would like my "New Game" button to generate "Sudoku" values, I want it to be random enough that it isn't a set amount of games, but also accurate enough to not produce impossible games

h4r1m4u
@h4r1m4u
Feb 18 2016 09:37
@Sivilll in that case i'd go with wordpress and the woocommerce plugin. it's got everything baked in that you'd need for a small store like that. you could develop the same from scratch, but it seems unnecessary to me. it'd be much more work. if you do want to do it yourself from scratch, you can choose any technology/framework you like (node.js/MEAN, rails, django, laravel, ...). the options are limitless
Casey Heath
@ExhibitArts
Feb 18 2016 09:37
Do any of you know why the nav links and text move to the left and out of the viewport when I resize my browser window? - http://explorecode.byethost8.com/
Kietil
@Kietil
Feb 18 2016 09:40
@h4r1m4u ok thanks for answer - nice picture :) an oter :)
CamperBot
@camperbot
Feb 18 2016 09:40
sivilll sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1430 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 18 2016 09:41
@Sivilll you're welcome. i've built a number of e-commerce sites and wordpress + woocommerce is a solid choice.
(it's a honey badger, actually :))
Kietil
@Kietil
Feb 18 2016 09:44
@h4r1m4u i looked at your repo of practice solutions.. i think i should look into that, since i am at basic level. It should teach me something valueable
h4r1m4u
@h4r1m4u
Feb 18 2016 09:45
@Sivilll be my guest. though you'll learn most by trying to do the FCC waypoints and ziplines on your own. there's nothing like working through a problem yourself.
Kietil
@Kietil
Feb 18 2016 09:45
can the tasks be found at codecampers website?
h4r1m4u
@h4r1m4u
Feb 18 2016 09:45
yes. in the map section.
Kietil
@Kietil
Feb 18 2016 09:45
what is FCC waypoints and ziplines?
h4r1m4u
@h4r1m4u
Feb 18 2016 09:46
the freecodecamp exercises
that's what they were called until a few weeks ago
Kietil
@Kietil
Feb 18 2016 09:47
ok, i think it will be useful to go through them :)
thanks for answering my questions, be well
h4r1m4u
@h4r1m4u
Feb 18 2016 09:48
np
dseright
@dseright
Feb 18 2016 10:08
Well I got through the tribute page project. The portfolio project seems much more daunting though.
Ankit Panwar
@coderNoob
Feb 18 2016 11:01
This message was deleted
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:13
@ExhibitArts you seem to be using a lot of position absolute, is there any reason why?
Casey Heath
@ExhibitArts
Feb 18 2016 11:15
@alexgaudiosi That's just how I positioned things. I'm new to HTML & CSS so I'm not really sure when to use that property and when not to.
Any tips for a noob?
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:16
So I would only use it when you have to position something on top of something else, for example you have a an image, then want to place some text on top
but for example I noticed one element has right -90%, that will absolutely position it -90% of the page, so as you resize it will have some strange side effects (like going off the page)
so try and use it sparingly, instead try and get your head around div positioning through well laid out html
like fitting tetris blocks
if you want to fit things on the same line for example, read up on display: inline-block and/or float: left/right
also a note on position absolute, to keep it positioned in relation to the 'container div', so where it is supposed to be contained within, add position: relative to the parent div (where it's supposed to sit within)
Casey Heath
@ExhibitArts
Feb 18 2016 11:24
@alexgaudiosi Thanks! I'm gonna copy that and save it in Notepad so I can look back at it when I need to.
CamperBot
@camperbot
Feb 18 2016 11:24
exhibitarts sends brownie points to @alexgaudiosi :sparkles: :thumbsup: :sparkles:
:star: 7 | @alexgaudiosi | http://www.freecodecamp.com/alexgaudiosi
h4r1m4u
@h4r1m4u
Feb 18 2016 11:26
@ExhibitArts reading through this http://learn.shayhowe.com/advanced-html-css/detailed-css-positioning/ might clarify and help a lot
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:28
Hi, could anyone help me with JSONP?
Casey Heath
@ExhibitArts
Feb 18 2016 11:28
@h4r1m4u IDK. i feel like my way is a lot easier but it gives off a weird effect.
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:38
@pedronfigueiredo What's up?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:38
I am doing the twitch zipline and I cannot nest JSONP call because it is asyncronous
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:40
I haven't done that course, but maybe if you show me a snippet of your problem I might be able to help
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:45
@alexgaudiosi
document.getElementById("wrapper").innerHTML = "Loading...";
var users, str, apiUrl = [];
users = ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff"];
window.onload = function loadOnStart() {
  document.getElementById("wrapper").innerHTML = "";
  for (var i = 0; i < users.length; i++) {
    str = "https://api.twitch.tv/kraken/streams/" + users[i] + "?callback=myCallback";
    apiUrl.push(str);
    document.getElementById("wrapper").innerHTML += "<a href = '" + apiUrl[i] + "' target = '_blank'><div class = 'row' id = 'channel" + i + "'><h4>" + users[i] + "</h4><p>dummy text</p></div><a/>";
  }
}
this is what I have
so it is returning the API stuff to a function myCallback
but now I am not sure how to use the info
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:47
ah okay
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:47
the hint from FreeCodeCamp was
$.getJSON(str, function(data) {
console.log(data);
 }
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:47
so in your console, does the object it returns have a variable name, like data?
okay cool
but getJSON is assynchronous, meaning the calls dont return the values like they should, if I nest them in a for loop
I don’t know it’s weird
btw I don’t have a console because I moved to Atom but I still don’t know how to install a console
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:50
so best is to use the browser console, what browser/operating system do you use?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:51
safari
or chrome
can do any of them
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:52
okay, on a mac?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:53
yeah
I figured out how to put console on chrome
good
ty man
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:53
so for chrome, if you press cmd+alt+j
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:53
yeah :)
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 11:54
then, for your code, the object should be in your console
so sometimes to access the data you need to navigate through the object, for example data.mydata[0]
the 0 will be the first nested listing, then 1 the second
[ 0 ] [ 1 ]
with no spaces
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 11:57
yeah
just a sec, trying stuff
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:03
Captura de ecrã 2016-02-18, às 13.02.39.png
I think this image is a good example of my problem
the JSON calls only resolve after the entire for loop, and not during as intended
so I think it is just the way they work
but I am not sure what to do to work around it
@alexgaudiosi I hope it makes sense
h4r1m4u
@h4r1m4u
Feb 18 2016 12:05
@pedronfigueiredo IIFE is your savior. do this:
document.getElementById("wrapper").innerHTML = "Loading...";
var users, str, apiUrl = [];
users = ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff"];
window.onload = function loadOnStart() {
  document.getElementById("wrapper").innerHTML = "";
  for (var i = 0; i < users.length; i++) {
   (function(i) { // THIS ADDED
       str = "https://api.twitch.tv/kraken/streams/" + users[i] + "?callback=myCallback";
       apiUrl.push(str);
       document.getElementById("wrapper").innerHTML += "<a href = '" + apiUrl[i] + "' target = '_blank'><div class = 'row' id = 'channel" + i + "'><h4>" + users[i] + "</h4><p>dummy text</p></div><a/>";
    })(i); // THIS ADDED
  }
}
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 12:06
okay, just popping out for lunch but maybe try wrapping the getjson part in it's own function, so the loop calls the function
or that ^
h4r1m4u
@h4r1m4u
Feb 18 2016 12:06
if you're not familiar with IIFE, look it up. here's a classic piece to get you started: http://benalman.com/news/2010/11/immediately-invoked-function-expression/. (check out the Saving state with closures section in particular as it relates to your problem)
@pedronfigueiredo it seems you modified your original code snippet as it's different from the last screenshot. so just use the code from the screenshot with the IIFE added as above
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:08
Okok
going to read the article now
@h4r1m4u what is a State?
h4r1m4u
@h4r1m4u
Feb 18 2016 12:16
@pedronfigueiredo a particular "moment" or "condition" in the execution of your code
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:16
ok perfect!
var users, str, online, apiUrl = [];
users = ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff"];
window.onload = function loadOnStart() {
  document.getElementById("wrapper").innerHTML = "";

  for (var i = 0; i < users.length; i++) {
    (function(lockedInIndex){
      str = "https://api.twitch.tv/kraken/streams/" + users[lockedInIndex] + "?callback=?";
      apiUrl.push(str);
      document.getElementById("wrapper").innerHTML += "<a href = '" + apiUrl[lockedInIndex] + "' target = '_blank'><div class = 'row' id = 'channel" + lockedInIndex + "'><h4>" + users[lockedInIndex] + "</h4><p>dummy text</p></div><a/>";
      console.log("YEAH" + lockedInIndex);
    $.getJSON(str, function(data) {
       console.log(data);
       online = Boolean(data.stream);
       if (online) {
         document.getElementById("wrapper").innerHTML += "<br>Online";
       } else {
         document.getElementById("wrapper").innerHTML += "<br>Offline";
       }
     })
    })(i);
  }

}
but it is not working :(
h4r1m4u
@h4r1m4u
Feb 18 2016 12:18
(function(i){
...
})(i);
the variables must match
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:20
var users, str, online, apiUrl = [];
users = ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff"];
window.onload = function loadOnStart() {
  document.getElementById("wrapper").innerHTML = "";

  for (var i = 0; i < users.length; i++) {

    (function(i){ //IIFE

      str = "https://api.twitch.tv/kraken/streams/" + users[i] + "?callback=?";
      apiUrl.push(str);
      document.getElementById("wrapper").innerHTML += "<a href = '" + apiUrl[i] + "' target = '_blank'><div class = 'row' id = 'channel" + i + "'><h4>" + users[i] + "</h4><p>dummy text</p></div><a/>";
      console.log("YEAH" + i);
    $.getJSON(str, function(data) {
       console.log(data);
       online = Boolean(data.stream);
       if (online) {
         document.getElementById("wrapper").innerHTML += "<br>Online";
       } else {
         document.getElementById("wrapper").innerHTML += "<br>Offline";
       }
     })

   })(i); //IIFE

  }

}
sorry, my bad.
but still doesnt work
h4r1m4u
@h4r1m4u
Feb 18 2016 12:20
do you have it in codepen?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:21
no
I’ll create one right now
sorry!
it is solved
Thank you @h4r1m4u
CamperBot
@camperbot
Feb 18 2016 12:23
pedronfigueiredo sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1431 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:24
where did you learn this? you saved my life
h4r1m4u
@h4r1m4u
Feb 18 2016 12:25
oh, you figured it out? great.
yeah, this baffles a lot of people
i ran into the same problem in my zipline, did the research and found the solution
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:26
is there a way to learn more of these kind of common problems?
I feel helpless when this happens
h4r1m4u
@h4r1m4u
Feb 18 2016 12:27
books on javascript, i'd imagine. i usually just google when i run into something like this
it's the best way to learn, imo. just work on projects and when you get stuck, look for the solution to your problem
reading books is great for the high-level, general overview, but nothing beats the actual coding experience and working through problems
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:28
yeah I think you are right
I started coding a month ago but I hit so many plateaus
can you give me a quick feedback on my portfolio?
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:29
Hey can anyone help me with the wikipedia API? i have troulbe getting it to work
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:29
@rune-jacobsen I can. What have you found?
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:30
I found what end to use to get it to search, but when i implement in on the site i get errors and i have no idea where to start
Something like the browser doesnt give you access to it @pedronfigueiredo
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:31
Ok. what errors do you get?
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:32
XMLHttpRequest cannot load https://en.wikipedia.org//w/api.php?action=query&format=json&list=search&utf8=1&srsearch=c&srnamespace=0&srwhat=text&srprop=snippet%7Ctitlesnippet&c. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:33
ok. where did you get the url from?
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:35
I got the search parameter from the input text field, then i put that in where it says search= and then i try using $getJSON
$.getJSON*
h4r1m4u
@h4r1m4u
Feb 18 2016 12:35
@pedronfigueiredo generally looks good. i didn't check the code, so i can't comment on that, but the functionality seems to be there. i noticed a little bug in the pomodoro - when i change the length of the break, it shows the work session length on the main clock, but when i click the clock to start the countdown it changes to the break length. i also miss a reset button there, but i realize you're using the +/- buttons to reset the clock.
i think most of the projects could do with some improvement on the design side of things, but i realize that design and development are two different things and you might be more focused on the latter.
overall, if you've started coding only a month ago, you're doing great. some really good progress. keep it up!
@rune-jacobsen add callback=? into the URL as one of the parameters
so the URL you use in your getJSON should look like this:
https://en.wikipedia.org//w/api.php?callback=?&action=query&format=json&list=search&utf8=1&srsearch=c&srnamespace=0&srwhat=text&srprop=snippet%7Ctitlesnippet&c
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:37
@h4r1m4u Thank you so much for taking a look! you are absolutely right, I have notice that bug also, I have to make sure I have counters for each dial and I think It will solve it. Will think about the reset button. Main reason I didn’t implemented it is because of mobile. Didn’t have space to put it.
CamperBot
@camperbot
Feb 18 2016 12:37
pedronfigueiredo sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pedronfigueiredo already gave h4r1m4u points
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:38
@h4r1m4u How do you think I can improve on design in general? are there any sort of guidelines or is it just aesthetics?
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:39
@h4r1m4u yes! it actually returns something error free now!
@h4r1m4u Thanks!
CamperBot
@camperbot
Feb 18 2016 12:39
rune-jacobsen sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1432 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 18 2016 12:41
@pedronfigueiredo no problem. you could put it under the main clock time. or even all the way at the bottom, under the work and break counters.
design-wise, yeah, it's mostly the visuals and aesthetics. design is obviously a different skill from development, but even if it's not your main focus, you can learn a lot by checking out different sites and using concepts that you find visually interesting in your own projects
@rune-jacobsen my pleasure!
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:41
@h4r1m4u So the only thing wrong was the callback?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:42
@rune-jacobsen yeah I had the same problem yesterday so you are on the right track :)
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:43
GREAT! thanks guys! @pedronfigueiredo @h4r1m4u
CamperBot
@camperbot
Feb 18 2016 12:43
rune-jacobsen sends brownie points to @pedronfigueiredo and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: rune-jacobsen already gave h4r1m4u points
:star: 301 | @pedronfigueiredo | http://www.freecodecamp.com/pedronfigueiredo
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:43
@h4r1m4u yeah I am definetly try to do it. Maybe also improve a little bit my old projects
h4r1m4u
@h4r1m4u
Feb 18 2016 12:43
@rune-jacobsen it's what was causing the cross-domain request issue because the wiki server is not configured to respond to pure JSON requests. adding the callback parameter is a workaround, it changes the request a JSONP one. the wikipedia article on JSONP is a good intro into the topic: https://en.wikipedia.org/wiki/JSONP, but you'll probably want to do some more reading on it as it's a pretty common problem
Rune Bak Jacobsen
@runebakjacobsen
Feb 18 2016 12:43
@h4r1m4u Yeah ill read it now, thanks again!
CamperBot
@camperbot
Feb 18 2016 12:43
rune-jacobsen sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: rune-jacobsen already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Feb 18 2016 12:43
@pedronfigueiredo sounds good :thumbsup: step by step. as i mentioned above, your progress is impressive
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:44
@h4r1m4u one more thing, if it is not too much. How does one count versions, to indicate them on GitHub. Everytime I make a commit is a new version?
I am thinking about start track some changes on the readme.md file
h4r1m4u
@h4r1m4u
Feb 18 2016 12:46
@pedronfigueiredo no, commits are not versions. commits are just updates to the code. versioning is entirely up to you. typically if you add a new feature or make some major changes, you'd call it a new version
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:47
Ok, so no one is going to check if versions and commits correspond. That is perfect for what I want. Didn’t seem practical for me to do otherwise
kirbyedy
@kirbyedy
Feb 18 2016 12:48
sorry to interrupt, how do you put all that up to github ? i
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:48
@h4r1m4u you are an awesome person. Thank you for your time, attention and wisdom!
CamperBot
@camperbot
Feb 18 2016 12:48
pedronfigueiredo sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pedronfigueiredo already gave h4r1m4u points
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:48
yeah @kirbyedy
kirbyedy
@kirbyedy
Feb 18 2016 12:48
do you create all locally and then just push it up to github ?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:48
I noticed that codepen is not ideal for portfolio so I dug this up two days ago
kirbyedy
@kirbyedy
Feb 18 2016 12:48
is there any limit ?
h4r1m4u
@h4r1m4u
Feb 18 2016 12:48
yeah, commits and versions are not necessarily intertwined. i wouldn't worry about it too much.
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:48
yeah if the branch name is gh-pages you can load it on a browser, how cool is that @kirbyedy
Thabani Manzini
@ThabaniM
Feb 18 2016 12:49
hello ppl having trouble with converting back to celsius after clicking once on my weather app any ideas http://codepen.io/ThabaniM/pen/OMqaWr/?editors=0010
kirbyedy
@kirbyedy
Feb 18 2016 12:50
is there a way to host images on gh ?
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:50
yeah I think so. and it is free
I am using the github desktop client and it seems doable. You just drag and drop to the clone folder on finder and commit+sync @kirbyedy
kirbyedy
@kirbyedy
Feb 18 2016 12:52
I did upload my portfolio through one tutorial, which of course I cant find now... but the images are on a cloud service
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:52
@ThabaniM did you declare variables kelvin celsius fahrneheit?
kirbyedy
@kirbyedy
Feb 18 2016 12:53
so if I can upload images on gh that is great, I will have to try that
Thabani Manzini
@ThabaniM
Feb 18 2016 12:53
yes
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:53
yeah GitHub it is amazing @kirbyedy, new world for me but amazing
Thabani Manzini
@ThabaniM
Feb 18 2016 12:53
but did not attach var in front
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:53
declare at the beginning
Thabani Manzini
@ThabaniM
Feb 18 2016 12:53
to make it global
kirbyedy
@kirbyedy
Feb 18 2016 12:53
:thumbsup:
Pedro Figueiredo
@pedronfigueiredo
Feb 18 2016 12:53
but that is not the problem
can you do console.log(kelvin), etc after assigning values just to check if it is working? @ThabaniM
alex chirila
@al3xoi
Feb 18 2016 12:58
Hello everyone, I have a small question regarding the pomodoro clock challenge
I'm getting a small 1 second delay on my timer and I dont know exactly why
can anyone take a look and see if im missing something?
Thabani Manzini
@ThabaniM
Feb 18 2016 12:59
@pedronfigueiredo it does work because if i press once 26 degrees celsius becomes 79 degrees farenheit or something
@pedronfigueiredo but if i try clicking a second time it fails to change back to celsius
Mafalda
@otmeek
Feb 18 2016 13:02
my next task is to make the simon game. Could someone give me a few pointers on how to style the button divs to look like circle quarters like the example? http://codepen.io/Em-Ant/full/QbRyqq/
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 13:06
I would personally use an SVG, but you if you search for html/css doughnut shapes, it should put you in the right direction, i.e. http://jsfiddle.net/CevXD/
SVG is if you want more shape manipulation which might be overkill for that
Mafalda
@otmeek
Feb 18 2016 13:47
@alexgaudiosi thank you for the links. My problem with using a doughnut shape is that I'm not sure how to split it into different parts ( one div per button)
CamperBot
@camperbot
Feb 18 2016 13:47
otmeek sends brownie points to @alexgaudiosi :sparkles: :thumbsup: :sparkles:
:star: 10 | @alexgaudiosi | http://www.freecodecamp.com/alexgaudiosi
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 13:50
 .doughnut { 
    background-color:red;
    border-radius: 150px 0 0;
    height:150px;
    width:150px;
}
try that
oh mah gad this formatting
Mafalda
@otmeek
Feb 18 2016 14:09
@alexgaudiosi awesome thanks! I managed to do this http://codepen.io/meek/pen/adrbOv so I think I know where to go from here.
CamperBot
@camperbot
Feb 18 2016 14:09
otmeek sends brownie points to @alexgaudiosi :sparkles: :thumbsup: :sparkles:
:warning: otmeek already gave alexgaudiosi points
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 14:10
:clap: welcome
Joseph
@HadziJo
Feb 18 2016 14:18
hello y'all!
anyone have a few minutes to explain a HTML <img> function?
Scott
@macengr
Feb 18 2016 14:23
I have been beating my head against the tic-tac-toe zipline for three weeks. After someone wins, my program clears the front end, clears the variables....and then plays two AI moves and one player move for the start of the next game. I can't figure out why. Anyone, please take a look. http://codepen.io/macengr/pen/obVexm
Alexander
@DurableMicron
Feb 18 2016 14:24
anyone know whats wrong with my js?
George Carroll
@ghcarrolljr
Feb 18 2016 14:27
I am new to the chat room. Just trying to get acclimated.
kirbyedy
@kirbyedy
Feb 18 2016 14:28
welcome @ghcarrolljr
Jake Plunkett
@jacobdplunkett
Feb 18 2016 14:30
good morning all, I am doing the front end challenge of creating a tribute page, and i ran into a snag. How do i get the bullets in my ul to go to the center of the page along with the li itself?
kirbyedy
@kirbyedy
Feb 18 2016 14:31
align center ?
Jake Plunkett
@jacobdplunkett
Feb 18 2016 14:32
i used a <center> element above it all, and everything moves to the middle except the bullet point
i can do it with the css but the excersice asks us not to use any
Scott
@macengr
Feb 18 2016 14:34
Are you using bootstrap, @jacobdplunkett ?
Jake Plunkett
@jacobdplunkett
Feb 18 2016 14:35
i am yea
Coira Ellison
@Coira
Feb 18 2016 14:35
@DurableMicron you need an api key to use the openweather api, and you need to start the address with //
e.g. //api.openweathermap/etc etc
you can check console to see the error messages by pressing f12, in this case there was a 404 error msg and then a 401 error msg
Jake Plunkett
@jacobdplunkett
Feb 18 2016 14:37
@macengr sorry yes i am
Scott
@macengr
Feb 18 2016 14:37
If you can't use CSS, put it in the center by using col-md-5, col-md-2, col-md-5 and then setting the margin of the element in the middle column so that it's centered?
kirbyedy
@kirbyedy
Feb 18 2016 14:38
@DurableMicron your api call should look something like this: http://api.openweathermap.org/data/2.5/weather?q=London&appid=44db6a862fba0b067b1930da0d769e98
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 14:40
@jacobdplunkett text-align: center
call that on the <li> item
Andrew Grabarnick
@leprekon91
Feb 18 2016 14:43
(weather forecast)I cant get the json object from the apicall, is there something wrong with my code?http://codepen.io/leprekon91/pen/VeOwwP/
Coira Ellison
@Coira
Feb 18 2016 14:44
@leprekon91 put // at the start of your api address (//api.etc)
Andrew Grabarnick
@leprekon91
Feb 18 2016 14:44
@Coira thank you!!!
CamperBot
@camperbot
Feb 18 2016 14:44
leprekon91 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 486 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Feb 18 2016 14:44
:)
faraz
@silentarrowz
Feb 18 2016 15:02
hi, could anyone help me with this. I am unable to control the size of the image in the about me section. sometimes, it gets bigger when i reduce the screen size and at other times, it becomes too small. of course, I was trying out different things, but am unable to get it to work the right way.
here's the link to the pen - http://codepen.io/silentarrowz/pen/ZQRvKL
the image size increases when I Reduce the screen size - why is this happening?
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:12
your declarations i think are a bit muddled up
one sec
do you want the overflow: hidden so it cuts off part of the photo?
try using
#about img {
  border:5px solid green;
 width: 100%;
}
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:17
that way, the image will follow any sizing you apply to it's container
faraz
@silentarrowz
Feb 18 2016 15:17
@alexgaudiosi no , I tried the overflow hidden and it was cutting part of the image so I removed it
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:18
add the width to the codepen you sent, it should work
Zay
@incognitonerd
Feb 18 2016 15:23
damn i hate when they start botherin shit that doesnt need to be bothered. do they have a way that i can complain about how the fucked up the homepage?
faraz
@silentarrowz
Feb 18 2016 15:24
@alexgaudiosi - I added the width:100% and i see the image gets bigger when I reduce screen size a bit and then it gets smaller as i reduce screen size even more
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:25
in responsive design that is how it should be generally
so that it scales with the page design
faraz
@silentarrowz
Feb 18 2016 15:26
@alexgaudiosi what I am getting is that it's not the largest size for the largest screen size. but it gets the largest size when I Reduce the screen a bit and then it gets smaller as I reduce the screen size more
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:26
when it jumps on to the new line right?
i'm not sure if you've started learning about media queries, but they will enable you to control dimensions of elements as the screen resizes
it gets larger because the content is being squeezed down the page, the width: 100%; will make it fill the empty space that it occupies
faraz
@silentarrowz
Feb 18 2016 15:30
@alexgaudiosi yeah, it gets bigger when it jumps to the new line
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:31
that's fine, it should be doing that :)
faraz
@silentarrowz
Feb 18 2016 15:31
@alexgaudiosi but why should it do that??
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:32
because imagine you are reading on a mobile, the layout must change so that the text is readable, right?
so the page will get longer so you can maintain readability
the idea is not to have an EXACT replica of the your desktop page, on a mobile, but to have a readable version of your website, make sense?
faraz
@silentarrowz
Feb 18 2016 15:33
right @alexgaudiosi
but then why cant I get the same image size when the screen is the largest size?? but then I have another problem of it breaking out of the div --- so how do I fix this then??
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:35
you can use max-width: 200px; (or whatever width) to control image size
if you apply it to the image
or min-width: xxxx; to set a minimum width it must be
faraz
@silentarrowz
Feb 18 2016 15:36
hmm, let me try that then @alexgaudiosi
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:36
or you can set that on the container of the image actually
and keep the image width 100%
to stop it breaking out
Sujit Karki
@Swoozeki
Feb 18 2016 15:36
@silentarrowz if you don't want image breaking out of the div, consider setting image width to 100%. This fills 100% of the div
faraz
@silentarrowz
Feb 18 2016 15:37
@alexgaudiosi one more thing. if you look at the portfolio images below , and when you hover over it, the images get bigger, but the paragraph underneath stays the same size, could you tell me a way to make the paragraph grow in size too along with the image??
@alexgaudiosi hmm , setting container size and keeping image width 100% sounds like a good idea too
Sujit Karki
@Swoozeki
Feb 18 2016 15:38
put both paragraph and image inside a div, and when you hover on the div, change both p and img size. div:hover p, div:hover img{}
Zerka1982
@Zerka1982
Feb 18 2016 15:39
Hello guys I need your help please
Sujit Karki
@Swoozeki
Feb 18 2016 15:40
What's up?
Zerka1982
@Zerka1982
Feb 18 2016 15:40
well
...
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:40
you can add a class to each of your divs with the items, so <div id="img1" class="hover-me col-md-4"><div id="img2" class="hover-me col-md-4"> etc, then change you css to
.hover-me:hover{
  box-shadow:0 0 10px 9px gray;
  max-width:220px;
  max-height:215px;
  position:relative;
  top:10px;
  z-index:1;
}
Zerka1982
@Zerka1982
Feb 18 2016 15:41
when move from one page to another ... on the top of my page it should show the root I am following
for example
faraz
@silentarrowz
Feb 18 2016 15:43
@alexgaudiosi @Swoozeki wait, take a look at this pen, so you can see where to make the changes - http://codepen.io/silentarrowz/pen/OMaPJj
oops , wrong url . here's the correct one - http://codepen.io/silentarrowz/pen/ZQRvKL
Zerka1982
@Zerka1982
Feb 18 2016 15:44
When I chose location , on the top of my page it shows: Helsinki then I clicked again ...
page too displayed on the top of my page : Helsinki > Dancing >
I clicked again and then a new page displayed, on the top it shows : Helsinki > Dancing > Lessons
It shows the root that I am following
Sujit Karki
@Swoozeki
Feb 18 2016 15:46
@Zerka1982 I can NOT help you with that, ahaha. I don't even know what you're talking about... Helsinki...Dancing...
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:46
This message was deleted
Zerka1982
@Zerka1982
Feb 18 2016 15:47
@Swoozeki pm please because its hard to describe it
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:47
This message was deleted
how do you embed codepen?
Zerka1982
@Zerka1982
Feb 18 2016 15:49
@Swoozeki would you mind ?
Gonzalo Moreno
@gonxaoro
Feb 18 2016 15:49
Hi guys and sorry about my bad english. I have a js error when i try get quotes using an api
Anyone can explain me?
faraz
@silentarrowz
Feb 18 2016 15:50
@alexgaudiosi applied what you said and now I see that the divs get bigger instead of the images and the paragraphs within it.
cant i do it in such a way that the images and paragraphs inside the divs get bigger
meatballcoder
@meatballcoder
Feb 18 2016 15:50
What is the error?
Zay
@incognitonerd
Feb 18 2016 15:50
does anyone know if its still possible to view ur finished challenges ? i cant find my finihsed challenges to save my life
faraz
@silentarrowz
Feb 18 2016 15:50
is there a way to target the images and paragraphs within the class .hover-me
??
Gonzalo Moreno
@gonxaoro
Feb 18 2016 15:51
@meatballcoder Uncaught TypeError: theQuote is not a function
Zerka1982
@Zerka1982
Feb 18 2016 15:51
Please anybody help me ... pm please
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:53
@silentarrowz
.hover-me:hover img,.hover-me:hover p{
  box-shadow:0 0 10px 9px gray;
  max-width:220px;
  max-height:215px;
  position:relative;
  top:10px;
  z-index:1;
}
Pradeep CE
@cepradeep
Feb 18 2016 15:53
@silentarrowz You can use something like
.hover-me img {
}
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 15:53
but you will have to play around with it
Pradeep CE
@cepradeep
Feb 18 2016 15:53
the space means img is a child of .hover-me
Sujit Karki
@Swoozeki
Feb 18 2016 15:54
@silentarrowz Just want to let you know, you have a really bad practise of positioning elements using pixels. The website is not going to be very responsive when you use pixels to position elements, unless you're also positioning elements absolute
meatballcoder
@meatballcoder
Feb 18 2016 15:54
@gonxaoro I don't see the callback function, "theQuote," like the error is communicating.
Pradeep CE
@cepradeep
Feb 18 2016 15:55
@Zerka1982 Post your code here, and someone should help you out :)
Gonzalo Moreno
@gonxaoro
Feb 18 2016 15:55
@meatballcoder But i must create the function? Idk
faraz
@silentarrowz
Feb 18 2016 15:56
@alexgaudiosi will do that. didnt know how to target 2 elements within the same class and I learnt that now. thanks @alexgaudiosi
CamperBot
@camperbot
Feb 18 2016 15:56
silentarrowz sends brownie points to @alexgaudiosi and @alexgaudiosi :sparkles: :thumbsup: :sparkles:
:star: 11 | @alexgaudiosi | http://www.freecodecamp.com/alexgaudiosi
:star: 11 | @alexgaudiosi | http://www.freecodecamp.com/alexgaudiosi
faraz
@silentarrowz
Feb 18 2016 15:56
@Swoozeki , what is the better way to position then if I dont want to use absolute??
and does absolute positioning help if I want page to be responsive?? @Swoozeki
Mafalda
@otmeek
Feb 18 2016 15:59
should I be using the different browser prefixes for properties like box-shadow all the time?
meatballcoder
@meatballcoder
Feb 18 2016 16:00
@gonxaoro if you reference a function, it has to exist. The callback is calling a function.
Pradeep CE
@cepradeep
Feb 18 2016 16:01
@otmeek Nope. Once the properties are standardized, the browsers will support them without the prefixes.
The prefixes are for proposed features that are not yet part of the standard. However, you should use them if you are worried about supporting that feature in older versions of the browser.
Zay
@incognitonerd
Feb 18 2016 16:03
logged in and logged out....not a single checkmark still.
20 mins ago it wouldnt scroll past longest streak. now its working. i think all my complainin made it to someones ear lmao
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 16:06
Zay
@incognitonerd
Feb 18 2016 16:12
alright thanks to whoever else commented. im goin back to work. later campers
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:16
@meatballcoder idk how solve this
i still trying
but i dont know why happen
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:25
I simplify the code
If anyone know why i get callback error..
kirbyedy
@kirbyedy
Feb 18 2016 16:31
@gonxaoro where did you get the api from?
Caleb Martin
@caleb272
Feb 18 2016 16:32
hello all
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:33
@gonxaoro
theQuote wasn't defined anywhere, and your .on(...) needed to be changed a little
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:37
thanks!
@Coira thanks !
CamperBot
@camperbot
Feb 18 2016 16:38
gonxaoro sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 487 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Feb 18 2016 16:38
np! just a couple of small changes really
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:38
but i waste like 30min haha
Sujit Karki
@Swoozeki
Feb 18 2016 16:38
You guys are just doing the Tweet exercise, and already have such good understanding of jSON, holy crap!
Coira Ellison
@Coira
Feb 18 2016 16:38
that's coding for you :p
Sujit Karki
@Swoozeki
Feb 18 2016 16:39
When I did it, I had an array of 15 codes I copied and pasted, and randomised it on the screen :|
*15 quotes
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:39
haha
kirbyedy
@kirbyedy
Feb 18 2016 16:40
I did it the same way :)
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:40
but must be do with ajax
kirbyedy
@kirbyedy
Feb 18 2016 16:41
no does not say it has to be done with ajax
Sujit Karki
@Swoozeki
Feb 18 2016 16:41
don't think there was a requirement that we had to use ajax or jSON, but it's definitely a much better way
kirbyedy
@kirbyedy
Feb 18 2016 16:41
you can if you want, but its not obligatory
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:41
Two years ago I did not use ajax haha
Gonzalo Moreno
@gonxaoro
Feb 18 2016 16:47
Ty guys, see u!
dhoover1
@dhoover1
Feb 18 2016 16:54
hey, i was wondering if someone would be willing to help me~~ ?_?
I'm working on the "portfolio" and i'm kind of stuck trying to use divs to display thumbnails that are links.
right now the divs are overlapping the floating header
heres the project if anyone is willing
Dick Fink
@dickfink
Feb 18 2016 16:59
hey @dhoover1, look into the css property “z-index”: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
dhoover1
@dhoover1
Feb 18 2016 17:00
@dickfink thanks so much! I will take a look!
CamperBot
@camperbot
Feb 18 2016 17:00
dhoover1 sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 176 | @dickfink | http://www.freecodecamp.com/dickfink
Jonah Erlich
@jerlich97
Feb 18 2016 17:03
Hi everyone,
I'm working on the local weather challenge and am struggling to run a function. I have a function called getData() that retrieves the api info and displays them on the DOM. My problem is it won't run on load, it only runs when I click an anchor tag with the "onload=" property. Any thoughts? http://codepen.io/jerlich97/pen/VeNEEK?editors=1011
James
@jamesgraham10
Feb 18 2016 17:07
@dhoover1 Your design skills are pretty awesome! I love that pinky-red / blue gradient
and you got the gradient as the color of the heading which is cool
dhoover1
@dhoover1
Feb 18 2016 17:09
@jamesgraham10 thanks, i wanted to use bright colors and it kind of came together.
CamperBot
@camperbot
Feb 18 2016 17:09
dhoover1 sends brownie points to @jamesgraham10 :sparkles: :thumbsup: :sparkles:
:star: 132 | @jamesgraham10 | http://www.freecodecamp.com/jamesgraham10
Jonah Erlich
@jerlich97
Feb 18 2016 17:19
Any suggestions for the weather app I posted above? I could really use some help
Mafalda
@otmeek
Feb 18 2016 17:22
@alexgaudiosi only saw your link now, thanks!
CamperBot
@camperbot
Feb 18 2016 17:22
otmeek sends brownie points to @alexgaudiosi :sparkles: :thumbsup: :sparkles:
:star: 12 | @alexgaudiosi | http://www.freecodecamp.com/alexgaudiosi
Dulshani Gunawardhana
@dshgna
Feb 18 2016 17:24
Quick question, in your calculators how did you handle cases such as "-4", "+4", "4+-6"?
Mafalda
@otmeek
Feb 18 2016 17:25
@jerlich97 I might be wrong, but it might be because your code isn't within
$( document ).ready(function() {
    console.log( "ready!" );
});
document ready function
Jonah Erlich
@jerlich97
Feb 18 2016 17:25
@otmeek right but I call the functions there. Does the entirety of the code need to be within that scope?
James
@jamesgraham10
Feb 18 2016 17:26
yes! @jerlich97
actually i’m not sure, it’s good practise though generally?
Mafalda
@otmeek
Feb 18 2016 17:26
@jerlich97 I don't see the function at all in your code, but I'm probably just missing it
I'm not sure whether all the code needs to be inside that function since I've never tried to not have it like that
Maulik Darji
@maulikdarji
Feb 18 2016 17:27
@dshgna JS eval() handles it :smile:
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:28
@jerlich97 why are you calling showPosition again without passing any arguments?
James
@jamesgraham10
Feb 18 2016 17:28
I’ve heard using eval() is evil
Mafalda
@otmeek
Feb 18 2016 17:29
@jamesgraham10 it is indeed but acceptable for the calculator project
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 17:29
it doesn't have to be with the .ready function
James
@jamesgraham10
Feb 18 2016 17:29
ah ok
Mafalda
@otmeek
Feb 18 2016 17:29
I honestly haven't been able to think of a way to chain multiple operations without using eval(), I'm sure it's doable just more work
Jonah Erlich
@jerlich97
Feb 18 2016 17:30
@NickEU What do you mean?
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:31
getLocation();
  showPosition();
  getData();
@jerlich97 what's with the showPosition call here? why?
Vincent Lingle-Munos
@valmunos
Feb 18 2016 17:31
working on the quote machine... does any body have any helpful documentation on working with APIs? I feel like the challenges haven't helped me at all.
Jonah Erlich
@jerlich97
Feb 18 2016 17:31
@NickEU Didn't realize it's called in getLocation(). 1 sec
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:32
@jerlich97 ofc it is it's just a callback
Jonah Erlich
@jerlich97
Feb 18 2016 17:32
@NickEU Ok so now my getData() function returns a 404 from the api call
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:32
@jerlich97 the reason your app doesn't work is cause u're calling it again later manually without passing anything through, so just get rid of that call
Jonah Erlich
@jerlich97
Feb 18 2016 17:32
@NickEU Heres the updated version: http://codepen.io/jerlich97/pen/VeNEEK?editors=1111
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:32
don't use settimeout btw
Jonah Erlich
@jerlich97
Feb 18 2016 17:33
@NickEU I think the issue is that it gets the coordinates after I call the API so they're not part of the api call
Andrew Charlebois
@andrewchar
Feb 18 2016 17:34
hey guys, im trying to resize an icon on my page and nothing is targeting my icon, instead it seems to be targeting only the space around it. anything i can do to fix this?
http://codepen.io/andrewchar/pen/dGrVJO?editors=1100
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:35
@jerlich97 that's because these API calls are async
Jonah Erlich
@jerlich97
Feb 18 2016 17:35
@NickEU So how do I delay the second API call?
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:36
@jerlich97 you can just do it inside the geolocation function call for example... you should really use a "global" variable to store the api response from weather api tbh, that will help you in the future
@jerlich97 it's a common problem, u're not the only one who stumbles upon it, lemme see if i can find some good info on this
Vincent Lingle-Munos
@valmunos
Feb 18 2016 17:37
Anybody have any good documentation on how to use APIs?
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:38
@jerlich97 http://stackoverflow.com/questions/11001318/waiting-for-api-call-to-finish-in-javascript-before-continuing here's an explanation of what's happening and some ways around that
Jonah Erlich
@jerlich97
Feb 18 2016 17:38
@NickEU Do you mean define the API key globally, the getData()function, or both?
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:38
@valmunos read the api documentation of the api u're trying to use to figure out how it's working, google working with API javascript or JQUERY to figure out how to work with api properly
@jerlich97 no... just use an object and store the result of your api call in it...
@jerlich97 you do know u're getting a json object from your api call?
Jonah Erlich
@jerlich97
Feb 18 2016 17:40
@NickEU Yeah, I'm going to need to spend some time reading. Thank you so much! this has been really helpful
CamperBot
@camperbot
Feb 18 2016 17:40
jerlich97 sends brownie points to @nickeu :sparkles: :thumbsup: :sparkles:
:star: 374 | @nickeu | http://www.freecodecamp.com/nickeu
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:40
@jerlich97 it's a very useful thing to know, so take your time - now is a good time to practice working with objects too, so it's a win win ;)
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 17:42
@andrewchar you haven't got an img tag anywhere
Pauline
@chumswap
Feb 18 2016 17:43
@andrewchar how big/small are you trying to make it? I played with just changing the height in the css of #icon img and it changed the size of the weather icon. is that what you're looking for?
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 17:43
<img src="images/icon.jpg"> for example
Andrew Charlebois
@andrewchar
Feb 18 2016 17:43
@alexgaudiosi i just fixed it. i added .html to my jQuery and target my #icon img {} in my css and it works now
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 17:44
ah i see, didn't check the JS
Andrew Charlebois
@andrewchar
Feb 18 2016 17:44
@alexgaudiosi @chumswap thanks :)
CamperBot
@camperbot
Feb 18 2016 17:44
andrewchar sends brownie points to @alexgaudiosi and @chumswap :sparkles: :thumbsup: :sparkles:
:star: 279 | @chumswap | http://www.freecodecamp.com/chumswap
:star: 13 | @alexgaudiosi | http://www.freecodecamp.com/alexgaudiosi
Pauline
@chumswap
Feb 18 2016 17:44
:)
Anyone else finding the mediawiki API documentation not totally helpful?
It's really frustrating me
Andrew Charlebois
@andrewchar
Feb 18 2016 17:47
i had a a great time figuring out my api for this weather app... sarcasm intended
Nikolajs Korolkovs
@NickEU
Feb 18 2016 17:49
@valmunos if you're still here you can try this tutorial too = some good info there https://www.codecademy.com/en/tracks/youtube
Andrew Charlebois
@andrewchar
Feb 18 2016 17:49
anyone know a good site for high quality gradient wallpapers/backgrounds
Scott
@macengr
Feb 18 2016 17:52
I have been beating my head against the tic-tac-toe zipline for three weeks. After someone wins, my program clears the front end, clears the variables....and then plays two AI moves and one player move for the start of the next game. I can't figure out why. Anyone, please take a look. http://codepen.io/macengr/pen/obVexm
Chris C.
@chrisamsterdam1986
Feb 18 2016 17:58
Check out those sexy gradients :-D
Andrew Charlebois
@andrewchar
Feb 18 2016 18:00
@chrisamsterdam1986 wow thats amazing, thank you so much
CamperBot
@camperbot
Feb 18 2016 18:00
andrewchar sends brownie points to @chrisamsterdam1986 :sparkles: :thumbsup: :sparkles:
:star: 6 | @chrisamsterdam1986 | http://www.freecodecamp.com/chrisamsterdam1986
Alex Gaudiosi
@alexgaudiosi
Feb 18 2016 18:07
@macengr i don't really have time for a proper look, but I would suggest removing the alerts for now, and insert console.log('some text') everywhere in your functions
then you can see in the console how the stack is being called throughout your app
it's the best way to learn debugging your software :)
Robert Pietrzykowski
@Rambosiek
Feb 18 2016 18:19
This message was deleted
Andrew Charlebois
@andrewchar
Feb 18 2016 18:42
finished with my weather app, check it out lemme know what you think :)
http://codepen.io/andrewchar/pen/dGrVJO?editors=1100
Craig Banach
@CraigBanach
Feb 18 2016 18:43
@andrewchar looks good, I would definately round the temperature though.
@andrewchar I don't wanna know the temperature is 6.22832°F
@andrewchar Also your fahrenheit temperature is wrong.
Andrew Charlebois
@andrewchar
Feb 18 2016 18:44
oh?
thanks for pointing that out @cragsify
CamperBot
@camperbot
Feb 18 2016 18:45
andrewchar sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 328 | @cragsify | http://www.freecodecamp.com/cragsify
Craig Banach
@CraigBanach
Feb 18 2016 18:46
@andrewchar I know why too, if you haven't figured it out yet.
Andrew Charlebois
@andrewchar
Feb 18 2016 18:46
not sure, looking at it
Craig Banach
@CraigBanach
Feb 18 2016 18:47

@andrewchar instead of adding 32 to C * 9 /5 , you are concatenating the value so :

if c = 1,

c*9/5 = 1.8

1.8 + 32 = 1.832

Rahul Gandhi
@gandhirahul
Feb 18 2016 18:49
@cragsify In my case, @andrewchar weather app is showing correct value for temp in F
Craig Banach
@CraigBanach
Feb 18 2016 18:50
@gandhirahul @andrewchar still not for me : 3.46°C, 116.948°F
@andrewchar I'd advise you to compute the fahrenheit value in a seperate line and then using it as a variable in the .texT()
greg
@wearenotgroot
Feb 18 2016 18:56
@andrewchar put em in a parenthesis
Andrew Charlebois
@andrewchar
Feb 18 2016 19:04
doing it this way is still not giving me the correct answer
$("#convertBtnF").click(function() {
    var farValue = (updateWeather.main.temp * (9 / 5) + 32);

    $("#myTemp").text("Temp: " + farValue + "°F");
  })
greg
@wearenotgroot
Feb 18 2016 19:09
@andrewchar you sure
@andrewchar it's showing the correct temp here
Andrew Charlebois
@andrewchar
Feb 18 2016 19:10
haha i was doing the calculation wrong on my calculator
yeah its showing right now
greg
@wearenotgroot
Feb 18 2016 19:12
lol
Andrew Charlebois
@andrewchar
Feb 18 2016 19:12

in jQuery when i have something like this

$("#myTemp").text("Temp: " + farValue + "°F");

can i chain stuff after the .text like adding to make it round my number

greg
@wearenotgroot
Feb 18 2016 19:12
you can try to use toFixed
Craig Banach
@CraigBanach
Feb 18 2016 19:14
@andrewchar
$("#myTemp").text("Temp: " + Math.round(farValue) + "°F");
greg
@wearenotgroot
Feb 18 2016 19:15
@andrewchar celsius should be ok with 1 decimal behind the .
changed it around to show 1 decimal
Mafalda
@otmeek
Feb 18 2016 19:19
Does anyone have any idea why adding margin-top to the .power div in this add the same top-margin to every other element in the parent div? o_O http://codepen.io/meek/pen/adrbOv
Andrew Charlebois
@andrewchar
Feb 18 2016 19:20
@wearenotgroot @cragsify thanks for the help :)
CamperBot
@camperbot
Feb 18 2016 19:20
andrewchar sends brownie points to @wearenotgroot and @cragsify :sparkles: :thumbsup: :sparkles:
:warning: andrewchar already gave cragsify points
:star: 893 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Pauline
@chumswap
Feb 18 2016 19:29
hi everyone. I'm starting the wikipedia viewer and am just making sure to set up the api call correctly. all i want to do is see the JSON object in my console but for some reason i'm not getting anything. any ideas?
$(document).ready(function(){
    $.getJSON( "https://en.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&prop=extracts&titles=Stack+Overflow&exintro=1", function( data ) {
  console.log(data);
  });
});
dhoover1
@dhoover1
Feb 18 2016 19:40
Hello I was wondering if I could get someone to point me in the right direction. Working on the personal portfolio. I have a blank space next to the About section that I would like to put a pic/text into, but every time I try to divide the main div It breaks the whole layout. Any Advice?
Pauline
@chumswap
Feb 18 2016 19:53
@dhoover1 have you tried putting the img in its own div and messing with things like float:right? or, you may need to keep the about text in its own div and change its styling to be inline or inline block. have you tried those?
pixiefrog
@pixiefrog
Feb 18 2016 20:00
This message was deleted
Vincent Lingle-Munos
@valmunos
Feb 18 2016 20:07

can someone please explain why this isn't working:

http://codepen.io/valmunos/pen/BjeNBz

the link opens to JSON data, but I can't tell if my Pen is communicating with the website or not
Andrew Charlebois
@andrewchar
Feb 18 2016 20:09
you need to add listener to your button
err nvm lol
Vincent Lingle-Munos
@valmunos
Feb 18 2016 20:11
this should work right? If it's communicating with the server shouldn't it spit out a string?
Joseph Morse
@jnmorse
Feb 18 2016 20:13
@valmunos helps if you include jQuery if your going to make use of it
@valmunos need to click the cog in the js window to add it
Andrew Charlebois
@andrewchar
Feb 18 2016 20:15
ahh yes there you go, its giving you quotes now
that?
I already had that added
Joseph Morse
@jnmorse
Feb 18 2016 20:16
@valmunos when I loaded it wasn't not there
Vincent Lingle-Munos
@valmunos
Feb 18 2016 20:17
hmm... very strange... still doesn't seem to be working though
you guys are both getting some output?
Andrew Charlebois
@andrewchar
Feb 18 2016 20:18
yup
Vincent Lingle-Munos
@valmunos
Feb 18 2016 20:18
wth
Joseph Morse
@jnmorse
Feb 18 2016 20:18
do you have the https everwhere extention installed in your browser?