These are chat archives for FreeCodeCamp/HelpFrontEnd

30th
May 2016
Tyler Collins
@tjscollins
May 30 2016 00:00
@mutantspore Found it. HTTPS Everywhere was the culprit. Which makes sense.
Marek Slabicki
@thaniri
May 30 2016 00:00
@redixhumayun try making it a button and then toggling disabled = true or false
Tyler Collins
@tjscollins
May 30 2016 00:00
@mutantspore Thanks again.
CamperBot
@camperbot
May 30 2016 00:00
tjscollins sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: tjscollins already gave mutantspore points
Bruce Young
@mutantspore
May 30 2016 00:00
@tjscollins great :)
Marek Slabicki
@thaniri
May 30 2016 00:01
can anyone help me with a css border? i made a wrapper that doesnt wrap my elements in terms of height. http://thaniri.github.io/weatherApp/weatherApp.html
Fernand
@Ferdyboy81
May 30 2016 00:04
help!! how do i make my portfolio web page to scroll when clicking on nav menu instead of going straight to the selected page? http://codepen.io/Ferdyboy81/pen/aZorag
CamperBot
@camperbot
May 30 2016 00:04
no wiki entry for: how do i make my portfolio web page to scroll when clicking on nav menu instead of going straight to the selected page httpcodepenioferdyboy81penazorag
Bruce Young
@mutantspore
May 30 2016 00:07
@Ferdyboy81 throw this in your JS
 // smooth scrolling of viewport to target
  $('a[href^="#"]').click(function(event) {
    event.preventDefault();
    $('html,body').animate({
      scrollTop: $(this.hash).offset().top - 50
    }, 900);
  });
Fernand
@Ferdyboy81
May 30 2016 00:07
@mutantspore sweeeeeet!!! thank you!!
CamperBot
@camperbot
May 30 2016 00:07
ferdyboy81 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1659 | @mutantspore |http://www.freecodecamp.com/mutantspore
CSStiles
@CSStiles
May 30 2016 00:09
Hey, this is my first ever project--I'd appreciate any feedback. thanks
http://codepen.io/CSStiles/pen/JKjRyM
Fernand
@Ferdyboy81
May 30 2016 00:10
@mutantspore if i want to change the scroll speed do i just change the numbers on $(this.hash).offset().top - 50
}, 900); sorry i haven;t study java yet.
NewtonXu
@NewtonXu
May 30 2016 00:11
Hey guys, my weather system only works on http not https
What can i do?
Is there a way to always have the browser load in http
Bruce Young
@mutantspore
May 30 2016 00:12
@NewtonXu your pen? just put http://codepen.io/whatever
@mutantspore
its because the api only works in https right?
Bruce Young
@mutantspore
May 30 2016 00:15
@NewtonXu that link you posted works in chrome and safari
NewtonXu
@NewtonXu
May 30 2016 00:15
@mutantspore it does
Bruce Young
@mutantspore
May 30 2016 00:15
?? which api
NewtonXu
@NewtonXu
May 30 2016 00:15
its the recommended one, and i meant it doesnt work in https i think
when i change the link of codepen to https it doesnt run
Bruce Young
@mutantspore
May 30 2016 00:16
the OWM api works in http .. it wil do https if you PAY lol
NewtonXu
@NewtonXu
May 30 2016 00:16
haha
Bruce Young
@mutantspore
May 30 2016 00:16
@NewtonXu yes tha’s corrrect as you are trying to drag insecure data into a secure site
NewtonXu
@NewtonXu
May 30 2016 00:16
what happens if it gets loaded by the evaluators in https though :S
Bruce Young
@mutantspore
May 30 2016 00:16
not that the api doesn’t work
@NewtonXu that’s going to cause problems with all sorts of sites.. like a http only quotes api ..don’t worry. just mak eyour portfolio call it correctly .. you should also have put it in the FCC “i’ve finished” box the correct working way
NewtonXu
@NewtonXu
May 30 2016 00:19
@mutantspore i did, thank you!
CamperBot
@camperbot
May 30 2016 00:19
newtonxu sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1660 | @mutantspore |http://www.freecodecamp.com/mutantspore
Galen
@galencorey
May 30 2016 01:16
Hi! Does anyone here know anything about the minimax algorithm? I'm not quite sure why my code doesnt work because i'm not 100% sure about what is supposed to happen
Sacha Morgese
@TheOmegaBlack
May 30 2016 01:48
@mutantspore Sorry for the late reply. THANK YOU SO MUCH, I should have thought of something similar! :)
CamperBot
@camperbot
May 30 2016 01:48
theomegablack sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1661 | @mutantspore |http://www.freecodecamp.com/mutantspore
buiphuking
@buiphuking
May 30 2016 01:54
in html
onClick="window.location.href=window.location.href"
what is that mean guys ?????????
Randy Goldsmith
@Dueldrawer8
May 30 2016 01:56
does anyone have experiene with bootstrap on how to make the projects responsive? I've thought i made it responsive but when i look at it on my cell phone, things don't stack
Moisés Man
@moigithub
May 30 2016 02:02
@Dueldrawer8 check the grid system on bootstrap
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:06
@moigithub yeah i kinda don't get it even after reading it and looking on stack oveflow
my boxes stack.. but for some reason they don't when i go on my phone to look at it
http://codepen.io/duel_drawer8/pen/QEWGqM
like what does it mean when you stick in xs and med in the same div class?
Jonathan Mitchell
@Vanhealen
May 30 2016 02:14
How am I supposed to build the random quote generator machine if I’ve never built anything using Jquery or Javascript and I am not supposed to look at the code for the example??
Seems a bit impossible at this point because I don’t even know where to start
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:15
@Vanhealen part of being a programmer or software engineer is being able to solve problems breaking things down piece by piece
@Vanhealen start with what you know.. for example you know how to create an array.. just make an array and put some quotes in it. You also know how to use for loops correct? Then just use your html knowledge, create a button of some sorts so that whenever you click on that button your for loop, loops through the array of your quotes
Jonathan Mitchell
@Vanhealen
May 30 2016 02:17
I have NO IDEA how to interact javascript with html
all i did was the tutorials, and they are crap
I made an array of quotes, I do not know how to access specific things from the quotes array into html using javascript
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:18
well its a random quote generator.. your nto suppose to access specific things from your quotes.. in the tutorials there is a certain function you can use to access random things
math.random
Jonathan Mitchell
@Vanhealen
May 30 2016 02:19
thats not the hard part
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:19
create a button also.. look up how to do that in html or jquery.. easier in jquery using the .click() metho
Jonathan Mitchell
@Vanhealen
May 30 2016 02:19
how do I tell HTML to access something written in javascript
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:19
in codepen it pretty much just does it for you.. you do it by providing classes and ids
Jonathan Mitchell
@Vanhealen
May 30 2016 02:20
I understand how jquery can interact with ID's
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:20
so in your html you will have class="quotes" and in your javascript or jquery you need to select that class and then manipulate
Jonathan Mitchell
@Vanhealen
May 30 2016 02:20
but I want to do this in vanilla javascript
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:20
same thing in vanilla just a little bit more involved..do you have your code?
part of being a programmer is also knowing to do your research
Jonathan Mitchell
@Vanhealen
May 30 2016 02:23
Yeah
Well i’m not a programmer dude…...
obviosuly
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:24
Well your here to be a programmer correct?
Jonathan Mitchell
@Vanhealen
May 30 2016 02:24

I made an array of quotes

var quotes = [
"This is my first quote",
"This is my second quote",
"This is my third quote"
]

Then I made another JS file that will try to switch the html element and print out a specific quote

$(document).ready(function() {
    $(#quotes).html(Math.random(quotes_array.js))
})

Then I have the html (still in progress)

<!DOCTYPE html>
<header></header>
<body>
<div class="container-fluid">
    <div class="btn btn-primary">
        <div class="quotes text-center"> 
        <blockquote>The quotes go here</blockquote>
        </div>
    </div>
</div>
</body>
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:24
We need to act the part and do the part.. if you need help people will give it to you
Jonathan Mitchell
@Vanhealen
May 30 2016 02:25
And yeah I am here to become a programmer, but I am not one yet at all
or I could do something like this just to get one of them working
$(document).ready(function() {
    $(#quotes).html(console.log(quotes[0]))
})
I am not sure how to reference the javascript quotes array within the html thing. The ID of the html element is “quotes” but that doesn’t necessarily need to be the same ID as the name of the javascript array holding the quotes
if I could just figure out how they work together that would help
Randy Goldsmith
@Dueldrawer8
May 30 2016 02:29
heres an example of mine if it will help
http://codepen.io/duel_drawer8/pen/WQaEQR
redixhumayun
@redixhumayun
May 30 2016 02:33
This message was deleted

http://codepen.io/redixhumayun/pen/rLNzpm?editors=1111

This is my weather app. Any suggestions are welcome. Also, if anybody could point out to me why my animation for the icon won't work, I'd be very grateful.

Quoc Anh Nguyen
@quocanh261997
May 30 2016 02:41
hey guys, I'm doing the portfolio challenge and was wondering how to fit an image perfectly to a div ?
Connor Hastey-Palindat
@cpalindat
May 30 2016 02:42
Can anyone take a look at my pen? I'm not sure if im approaching this api stuff properly,
https://codepen.io/cpalindat/pen/Vjwarw?editors=1010
Greg Duncan
@GregatGit
May 30 2016 02:44
@quocanh261997 give the div and id - and then in css
#myDiv{
  display: block;
  height: 100%;
  background: url(yourImageUrl) no-repeat center fixed;
  background-size: cover;
}
Quoc Anh Nguyen
@quocanh261997
May 30 2016 02:45
ok thks @GregatGit
thanks @GregatGit
CamperBot
@camperbot
May 30 2016 02:45
quocanh261997 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 539 | @gregatgit |http://www.freecodecamp.com/gregatgit
Greg Duncan
@GregatGit
May 30 2016 02:46
@quocanh261997 here is a great template http://www.w3schools.com/bootstrap/bootstrap_scrollspy.asp
Adam Urberg
@aurberg
May 30 2016 02:47
Hi all, has anyone had issues with codepen being https but the weather api being http?
I get the error "This request has been blocked; the content must be served over HTTPS."
Greg Duncan
@GregatGit
May 30 2016 02:49
@aurberg yes
Adam Urberg
@aurberg
May 30 2016 02:50
@GregatGit did you find any work arounds?
Greg Duncan
@GregatGit
May 30 2016 02:50
make sure your pen isn't https
Connor Hastey-Palindat
@cpalindat
May 30 2016 02:52
@GregatGit Is that a better way to get lat/long then geolocation?
Greg Duncan
@GregatGit
May 30 2016 02:52
@ConnHurr for chrome it is
Adam Urberg
@aurberg
May 30 2016 02:54
@GregatGit So you used that so you can get the location without https so that you can use the weather api with http?
Connor Hastey-Palindat
@cpalindat
May 30 2016 02:55
@GregatGit So if I wanted to call that to get the latitude and longtitude I would do something such as:
```
$(document).ready(function() {

  $.getJSON("ip-api.com/json", function(data) {
    //stuff 
  });
});
the API stuff is confusing
Adam Urberg
@aurberg
May 30 2016 02:56
@ConnHurr I think you still need the http:// in front of the url
Greg Duncan
@GregatGit
May 30 2016 02:56
@ConnHurr where stuff is you do your next getJSON call using the lat and long from the first - and you have to have http in front
Connor Hastey-Palindat
@cpalindat
May 30 2016 02:57

Okay so I would use

lat  = data["lat}]

Or something similar?

"lat" * sorry
Greg Duncan
@GregatGit
May 30 2016 02:58
@aurberg in chrome a http page can get a https api but a https page can't get a http api
var lat = data.lat;
Adam Urberg
@aurberg
May 30 2016 02:59
@GregatGit But in chrome when http it cannot use navigator.geolocation.getCurrentPosition() correct?
Greg Duncan
@GregatGit
May 30 2016 02:59
correct
Adam Urberg
@aurberg
May 30 2016 02:59
@GregatGit Awesome, thanks for the help!
CamperBot
@camperbot
May 30 2016 02:59
:cookie: 540 | @gregatgit |http://www.freecodecamp.com/gregatgit
aurberg sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
Connor Hastey-Palindat
@cpalindat
May 30 2016 03:00
Would you mind checking this? I can't seem to get it to work, even just displaying the latitude
https://codepen.io/cpalindat/pen/Vjwarw?editors=1010
Greg Duncan
@GregatGit
May 30 2016 03:01
@ConnHurr remove the https from the address bar at the top of your browser and it works
Connor Hastey-Palindat
@cpalindat
May 30 2016 03:02
ohh
thank you!
Is that just a chrome/codepen thing?
Greg Duncan
@GregatGit
May 30 2016 03:02
yeah
Connor Hastey-Palindat
@cpalindat
May 30 2016 03:02
ohh alright well thank you @GregatGit! hopefully I can get the rest of this up and running now
CamperBot
@camperbot
May 30 2016 03:02
connhurr sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 541 | @gregatgit |http://www.freecodecamp.com/gregatgit
buiphuking
@buiphuking
May 30 2016 03:07
hi guys,
what my #choice doesn't show up
https://codepen.io/buiphuking/pen/beGMmN
okayaj
@okayaj
May 30 2016 03:38
Hello everyone! I'm trying to get a jQuery plugin, jRumble, to animate the links across the top header of my project. In testing the first link (About) I am unable to get the link to animate on hover. Can anyone tell me what I'm doing wrong? The jRumble code is at the bottom of the JS section, and the two links it asked me to embed are at the bottom of the HTML section between the <script> tags.
https://codepen.io/okayaj/pen/EyYzvr
Quoc Anh Nguyen
@quocanh261997
May 30 2016 03:43
hey guys, how can i add an image to codepen from my computer?
okayaj
@okayaj
May 30 2016 03:44
I host my images at Cloudinary and link them from there
imgur blocks codepen so you cant use that
Dennis Niemeijer
@daniemeijer
May 30 2016 03:47
@okayaj great advice! I've have been looking for a solution to use your own pics on codepen
okayaj
@okayaj
May 30 2016 03:48
@daniemeijer Yes! Cloudinary has been free and reliable so far. I recommend it.
Vik
@vvang044
May 30 2016 04:03
hello all
i am having trouble aligning my table to the center of the page
Kyle W Pilkinton
@tadake
May 30 2016 04:07
can anyone tell me whats wrong with my javascript? i did something then it broke. the problems with the start.click function i think
http://codepen.io/tadake/pen/VjZNON
Wyatt
@wyattsamb
May 30 2016 04:12
@vvang044 nest your table in <center> </center>
Kyle W Pilkinton
@tadake
May 30 2016 04:18
ok so this is the code where the error has too lie because when it isnt there the buttons work to count up minutes and seconds
$('#start').click(function(start){

   var myVar = setInterval(myTimer, 1000);

 function myTimer(start) {


  sec -= 1;

   $('#seconds').html(sec);

  if(min > 0 && sec === 0){

     $('#seconds').html(sec);
     $('#minutes').html(min);


   min -=1;
   sec = 60;

  }
 });
Vik
@vvang044
May 30 2016 04:19
@wyattsamb did you mean by <center> <table>.......</table></center>
Ken Haduch
@khaduch
May 30 2016 04:35
@tadake - one thing that you aren't doing is preventing the start of multiple interval timers.
Ken Haduch
@khaduch
May 30 2016 04:41

@tadake - and you aren't preventing the count from going negative - it does seem to start the counter, though. My suggestion for controlling the timer (to prevent the start of multiple timers) is that you can make the variable that you are using to receive the return from setInterval a global variable - you need to keep it around outside of the click function handler. Then, when you get another click that triggers the handler (this is one way to do it) have some code like this:

var timerVal = 0;  // the variable to keep the setInterval() return

// inside the click handler
$('#start').click(function(){
    if (timerVal === 0) {  // if a timer is not running, we can start one.
        timerVal = setInterval(myTimer, 1000);
    }
// ... your other code
});

Then in the place where you want to stop the timer, you have that value saved in timerVal, you can use it to delete the interval timer (you need it to do that.) And then make sure to reset timerVal to 0!

The second way to do this is that once you get a timer start, you can disable the "START" button until you stop the timer. And pay similar attention to the "STOP" button - if you aren't running the clock, you don't want to try and stop it.

I hope that helps?

Kyle W Pilkinton
@tadake
May 30 2016 04:42
thanks so much @khaduch !!! that helps greatly! lol im on the road and am trying to do this via mobile and it sucks lol. thanks!!!
CamperBot
@camperbot
May 30 2016 04:42
tadake sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1227 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
May 30 2016 04:43
@tadake - yeah - mobile work on this kind of stuff is really painful! Good luck...
Kyle W Pilkinton
@tadake
May 30 2016 04:44
thanks again !! @khaduch
CamperBot
@camperbot
May 30 2016 04:44
tadake sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: tadake already gave khaduch points
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:07
Hi guys, would anyone be able to help me with the open weather api? I managed to finally get the lan/lon working but now when I use the weather one nothing happens :(
redixhumayun
@redixhumayun
May 30 2016 05:10

http://codepen.io/redixhumayun/pen/beGKLq

Hey, can anyone tell me why this animation won't work? I have no idea what I'm doing wrong. It seems like some really simple syntax. I'm just triyng to get the search icon to move to the right when I click on it

Okay, apparently I just had to change the position to relative, although I have no idea why that makes sense.
Chris Cullen
@123xylem
May 30 2016 05:12

@123xylem


function whereAreYou(collection, source) {
  // What's in a name?
  var arr = [];
  // Only change code below this line
  var target =source;

  // Only change code above this line
  return target;
}

whereAreYou([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });

How can i make my var target == the property of source - IE
"capulet"
I can say source.last
but that is hardcoded

redixhumayun
@redixhumayun
May 30 2016 05:12
@ConnHurr Can you post a link to your codepen?
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:12
At this point I would be happy with getting the city name to show up
redixhumayun
@redixhumayun
May 30 2016 05:14
@ConnHurr Okay let me take a look
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:14
Thank you!
Bruce Young
@mutantspore
May 30 2016 05:17
@ConnHurr you don’t have an api key in the URL
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:17
How does that work?
From the instruction it seems like I only need to use a certain link
Bruce Young
@mutantspore
May 30 2016 05:18
@ConnHurr go to the OWM site ..signup for a free key
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:19
Well yes, but do I just add it to the end of the url in the .getJSON?
I cant find where to add it in the linked instructions :/
Brooke Ann S.
@tinyinkling
May 30 2016 05:21
Hey ya'll! Suggestions for good code library for color #'s in CSS ? :)
Bruce Young
@mutantspore
May 30 2016 05:22
&appid=cd10sdfsf8db1bd9e703fd35a57ba25d64c83
in the end of your url ..put YOUR key in though
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:23
ahhh I see
thank you @mutantspore !
CamperBot
@camperbot
May 30 2016 05:23
connhurr sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1663 | @mutantspore |http://www.freecodecamp.com/mutantspore
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:24
So this code should be correct?
    $.getJSON("http://www.api.openweathermap.org/data/2.5/weather?lat=" + data.lat + "&lon=" + data.lon + "&appid=7ea7b3e27e94c51013a9aa7527bd5286", function(data) {
      $("#name").html(data.name);
Bruce Young
@mutantspore
May 30 2016 05:25
@ConnHurr “suck it and see” lol yes
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:25
Haha
The reason I asked is because thats still not working lol
I've been playing around for a couple of hours, unforunately I can't seem to get any API stuff to click
Bruce Young
@mutantspore
May 30 2016 05:26
the pen you’re working on is…?
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:27
Jack Lyons
@JackEdwardLyons
May 30 2016 05:30
nm i figured it out
Bruce Young
@mutantspore
May 30 2016 05:30
@ConnHurr ok it’s api.open not www.api but also teh key seems to be erong
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:31
I copied it directly from the website, should I generate a new one?
Bruce Young
@mutantspore
May 30 2016 05:31
let me test with mine first
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:32
I fixed the url and my key seems to be working
Bruce Young
@mutantspore
May 30 2016 05:32
@ConnHurr so yo uhave name?
yes ok
so you’re ok now (for now)? @ConnHurr
Connor Hastey-Palindat
@cpalindat
May 30 2016 05:35
Yes I believe so! Thank you again @mutantspore !
CamperBot
@camperbot
May 30 2016 05:35
connhurr sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: connhurr already gave mutantspore points
Tyler Collins
@tjscollins
May 30 2016 06:20

http://codepen.io/tjscollins/pen/VjwxYy?editors=1111

Another question for my Weather Page: I've placed an invisible button over the temperature unit that is supposed to convert the units from metric to imperial when clicked, and back again when reclicked. This isn't working--instead the javascript is running the initial metricWeather(); and then running the imperialWeather(); and metricWeather() function calls on lines 3-4 immediately on page load without any clicking on the temperature unit. Clicking after this does nothing. I assume something is wrong with lines 3-4 in the script, but I can't tell what.

Ideas?

kirbyedy
@kirbyedy
May 30 2016 06:22
@tjscollins I guess it loads both, so maybe you should hide one
Tyler Collins
@tjscollins
May 30 2016 06:22
@kirbyedy It's loading both without waiting for a 'click' event.
kirbyedy
@kirbyedy
May 30 2016 06:23
on initial load you have celsius shown, and fahrenheit hidden, than on click, you hide celsius and show farenheit
Tyler Collins
@tjscollins
May 30 2016 06:23
@kirbyedy That's what should happen, but doesn't
kirbyedy
@kirbyedy
May 30 2016 06:24
yes, so hide the fahrenheit
Tyler Collins
@tjscollins
May 30 2016 06:24
@kirbyedy instead it's just running all 3 sequentially without waiting for the click event
kirbyedy
@kirbyedy
May 30 2016 06:24
hide()
Tyler Collins
@tjscollins
May 30 2016 06:26
@kirbyedy That would take a complete rewrite. They aren't hidden like that. They're rewritten entirely. Hiding would be more efficient, I suppose, but it doesn't explain why the $("CtoF").on("click", imperialWeather()); is executing without a click event.
kirbyedy
@kirbyedy
May 30 2016 06:31
because you are calling it ?
btw. you are speaking about efficiency but your code has a double line count... one for celsius and one for fahrenheit
isn`t it easier just to convert the already loaded data ?
and remove all that code
Tyler Collins
@tjscollins
May 30 2016 06:36
@kirbyedy Yes, but I'm trying to fix one problem at a time.
@kirbyedy What do you mean I am calling it?
@kirbyedy I'm trying to figure out why nothing happens when the button is clicked
kirbyedy
@kirbyedy
May 30 2016 06:42
well this is your console log
Screen Shot 2016-05-30 at 09.42.17.png
so when the document is loaded you trigger the metricWeather function, and then imperial weather and then again metricWeather function
and that is what your console showing
so you are overwriting
Tyler Collins
@tjscollins
May 30 2016 06:45
Yes. I said that when I asked for help. Nevermind, I figured it out on my own.
Thieu van Dijk
@Thieuvandijk
May 30 2016 06:45
Good morning!
Is there someone out there who can help me with the use of Api's in Javascript
I want to use an api in my random quotes machine.....
Jack Lyons
@JackEdwardLyons
May 30 2016 07:17
hey guys anyone wanna pair up for the roman numerals bonfire challenge?
redixhumayun
@redixhumayun
May 30 2016 07:42

http://codepen.io/redixhumayun/pen/beGKLq?editors=1111

Can anybody help me out with why my textbox won't display the input when I use console.log on it?

kirbyedy
@kirbyedy
May 30 2016 07:50
@redixhumayun Uncaught TypeError: "#form-input".val is not a function
as soon as your page loads this is the error from the console
Wyatt
@wyattsamb
May 30 2016 07:51
Can someone help me with something
Thieu van Dijk
@Thieuvandijk
May 30 2016 07:53
@wyattsamb maybe.......
NatixDev
@NatixDev
May 30 2016 08:15
Hi guys, I wanna know your opinion on this project : http://s.codepen.io/NatixDev/debug/MyMbNw
And I have a little bug with the width scroll, I don't know why it is scrolling and not going to responsive
Loïc Touzard
@LoicTouzard
May 30 2016 08:19
@NatixDev At the bottom of your page, in the contact form. You have labels over inputs
kirbyedy
@kirbyedy
May 30 2016 08:19
@NatixDev hmmm I dont see any horizontal scroll
Loïc Touzard
@LoicTouzard
May 30 2016 08:19
Writing in the input mix the texts,
kirbyedy
@kirbyedy
May 30 2016 08:19
@NatixDev but you have a problem here:
Loïc Touzard
@LoicTouzard
May 30 2016 08:19
it's ugly :/ Consider using placeholders ;)
kirbyedy
@kirbyedy
May 30 2016 08:19
Screen Shot 2016-05-30 at 11.19.05.png
Can anyone help me figure out how to stop running more than one instance of the timer
I can't figure it out
Samuel Cupidon
@Zerazera
May 30 2016 08:28
@plotterbaboom You could have some variable that tells you when the timer is running
plotterbaboom
@plotterbaboom
May 30 2016 08:28
The program works if you press the button once, but if you press twice it starts another instance that runs at the same time
like a true and false variable
?
where would I initialize this variable? Make a global variable?
kirbyedy
@kirbyedy
May 30 2016 08:32
@plotterbaboom maybe to disable the start button while the clock is running ?
plotterbaboom
@plotterbaboom
May 30 2016 08:34
Hmm but my problem is how to know the clock is running or to reset it without a new one running
NatixDev
@NatixDev
May 30 2016 08:37
I don't made it responsive actually
@LoicTouzard The website is ugly ?
Samuel Cupidon
@Zerazera
May 30 2016 08:39
@plotterbaboom It would basically be a boolean acting as a flag. Set it false when the timer is not running and true when the timer is running, and use the logic from that to keep your timer programming running more than once.
Loïc Touzard
@LoicTouzard
May 30 2016 08:39
@NatixDev Nope that's not what I meant
@NatixDev Was talking about a bug in the contact form
plotterbaboom
@plotterbaboom
May 30 2016 08:42
@Zerazera yeah I'll work on that
NatixDev
@NatixDev
May 30 2016 08:43
@LoicTouzard Ok I'll look for placeholders, ty dude
CamperBot
@camperbot
May 30 2016 08:43
natixdev sends brownie points to @loictouzard :sparkles: :thumbsup: :sparkles:
:cookie: 9 | @loictouzard |http://www.freecodecamp.com/loictouzard
NatixDev
@NatixDev
May 30 2016 08:46
I must work on the map, contact form and responsive
James Winfield
@jamesthemonkeh
May 30 2016 08:57
Hello. Is anyone free to point me in the right direction on the Random Quote Machine please?
kirbyedy
@kirbyedy
May 30 2016 09:04
@jamesthemonkeh what is the exact question?
James Winfield
@jamesthemonkeh
May 30 2016 09:05
@kirbyedy Well I don't really know what I'm doing wrong. I'm trying to parse the JSON but struggling to work it out http://codepen.io/jameswinfield/pen/JXYyjB
James Winfield
@jamesthemonkeh
May 30 2016 09:25
Finally got it!
Eric
@WareHouseGnome
May 30 2016 09:28
Hello all. Having a bit of trouble with the 'Show Local Weather' challenge. I keep getting an error: TypeError $.getJSON is not a function. I've checked for stray commas and semi-colons, I don't have an errant = anywhere. So I put the call inside of a function ( like i've seen others do) and that error went away. Now it just comes up 'undefined'. If some one could look at my code and point me in the right direction, it would be cool. My pen: http://codepen.io/warehousegnome/pen/JKjvwv?editors=1111
Leow Wei Xiang
@boyboi86
May 30 2016 09:33

dear all. having error with my code, pen.js:78 Uncaught ReferenceError: player is not defined

http://codepen.io/Boyboi86/pen/yJBjye

any help is appreciated
plotterbaboom
@plotterbaboom
May 30 2016 09:40
So I added a running flag to my pomodoro clock set to false intially. I added that the clock wont run if running = false;
however How do I stop the clock by setting running = false
and then start it again by setting running = true
Loïc Touzard
@LoicTouzard
May 30 2016 09:41
@WareHouseGnome Seems to be working for me O.o
Gintaras
@g1st
May 30 2016 09:45
how to make a href link to do nothing? just like href=# but that the page wouldn't move to the top of a page?
Eric
@WareHouseGnome
May 30 2016 09:47
@LoicTouzard OK, I was afraid of that. I've had some anomlies with my system lately ... I wonder what I did? Thanks for looking!
CamperBot
@camperbot
May 30 2016 09:47
warehousegnome sends brownie points to @loictouzard :sparkles: :thumbsup: :sparkles:
:cookie: 47 | @loictouzard |http://www.freecodecamp.com/loictouzard
Loïc Touzard
@LoicTouzard
May 30 2016 09:48
@g1st Do you want to bind something to your link ?
Like an event ? Or is it just from stylistic reasons
@g1st
<a href="#" class="noDefault">stay here! </a>
$(".noDefault").click(function(event){
    event.preventDefault();
    return false;
}
Gintaras
@g1st
May 30 2016 09:51
its just for stylistics
Loïc Touzard
@LoicTouzard
May 30 2016 09:51
mmh you can also try
<a href="javascript:void(0)"> Hello</a>
Gintaras
@g1st
May 30 2016 09:52
ok, i'll try both, thanks @LoicTouzard
CamperBot
@camperbot
May 30 2016 09:52
g1st sends brownie points to @loictouzard :sparkles: :thumbsup: :sparkles:
:cookie: 48 | @loictouzard |http://www.freecodecamp.com/loictouzard
Gintaras
@g1st
May 30 2016 09:54
That second one works like a charm :)
Loïc Touzard
@LoicTouzard
May 30 2016 09:56
;)
Anush Reddy
@anushreddy
May 30 2016 10:01
how to include image from our system ?
Loïc Touzard
@LoicTouzard
May 30 2016 10:02
<img src="path/to/img.png"/>
what do you mean by system ?
Anush Reddy
@anushreddy
May 30 2016 10:02
it is in my desktop
Loïc Touzard
@LoicTouzard
May 30 2016 10:02
where is your html file ?
Anush Reddy
@anushreddy
May 30 2016 10:03
i am using codepen
Loïc Touzard
@LoicTouzard
May 30 2016 10:04
I guess you have to upload is somehow
and then src="http://src-to-img"
Like if you have a dropbox for example
or you can also use imgur to upload your image @anush6533
Anush Reddy
@anushreddy
May 30 2016 10:06
ok thanks @LoicTouzard
CamperBot
@camperbot
May 30 2016 10:06
anush6533 sends brownie points to @loictouzard :sparkles: :thumbsup: :sparkles:
:cookie: 53 | @loictouzard |http://www.freecodecamp.com/loictouzard
James Winfield
@jamesthemonkeh
May 30 2016 10:32
I'm stuck on the random quote machine again - can anyone kindly advise where I am going wrong on my twitter button? http://codepen.io/jameswinfield/pen/VjwEZg
Joshua Swift
@joshuaswift
May 30 2016 10:34
Has anyone got any advice on centering buttons (within a row) using Bootstrap? In general I'm finding the column system quite difficult to get my head around!
Loïc Touzard
@LoicTouzard
May 30 2016 10:34
@Joshuaswift you could use the class center-block
But don't put element directly in a .row always in .col-smthing even for full width, use col-xs-12
@Joshuaswift
<div class="row">
    <div class="col-xs-12">
        <button class="btn btn-primary center-block"></button>
    </div>
</div>
Paul
@pdbroadfoot
May 30 2016 10:37
@WareHouseGnome
Joshua Swift
@joshuaswift
May 30 2016 10:38
I should add I
Paul
@pdbroadfoot
May 30 2016 10:38
@WareHouseGnome Hi there ... I got it going with the following ...
Joshua Swift
@joshuaswift
May 30 2016 10:39
@LoicTouzard Thanks that helps!
CamperBot
@camperbot
May 30 2016 10:39
joshuaswift sends brownie points to @loictouzard :sparkles: :thumbsup: :sparkles:
:cookie: 62 | @loictouzard |http://www.freecodecamp.com/loictouzard
Paul
@pdbroadfoot
May 30 2016 10:40
@WareHouseGnome
function locate () {
  $.getJSON("http://ip-api.com/json", function(data) {
            var table_body = "";
            $.each(data, function(k, v) {
                table_body += "<tr><td>" + k + "</td><td><b>" + v + "</b></td></tr>";
            });
            $("#demo").html("<table>" + table_body + "</table>");
        });
}
And just learning how to post ...
Anthony
@eyarie
May 30 2016 10:43
help pleeease
CamperBot
@camperbot
May 30 2016 10:43
no wiki entry for: pleeease
Anthony
@eyarie
May 30 2016 10:43
i am stuck with my front end project
i am trying to get the template first before inserting my content but i am stuck
please help
anyone
chetanmahore
@chetanmahore
May 30 2016 11:07
@eyarie which template
looks fine to me. just move the last block little a bit left.
Drake Leung
@lyyourc
May 30 2016 11:22
bst.png
someone know how to draw a binary tree using SVG???
SarthakAdhikari
@SarthakAdhikari
May 30 2016 11:55
https://codepen.io/sarthakadhikari/pen/MeWQbO The back button that appears after I click the 'Go!' button is not clickable.. I want it to be clickable.
Joshua Swift
@joshuaswift
May 30 2016 12:01
So I'm currently working on the Random Quote Generator and I can't figure out how to arrange the buttons along the bottom of the div, next to each other & centered
Student
@JmStudent
May 30 2016 12:02
Hi everybody
I'm doing Basic Front End Development Projects
Joshua Swift
@joshuaswift
May 30 2016 12:02
I feel there may be some unnecessary code as it's the first time I've had to use Bootstrap in an actual project, so far it's been a trial by fire!
Student
@JmStudent
May 30 2016 12:03
specifically a Personal Portfolio Webpage Incomplete   *
can anyone help me?
Connor Murphy
@papasmurph
May 30 2016 12:08
Any thoughts on this?
http://codepen.io/papasmurph93/full/NrWPgW/
It's 1 of the designs I'm playing about. Personally I'm unsure of the color of the font versus the background
Stephen James
@sjames1958gm
May 30 2016 12:12
@SarthakAdhikari It appears that some div or something is covering up the text / buttons after pressing go once, it doesn't work either.
Loïc Touzard
@LoicTouzard
May 30 2016 12:14
@SarthakAdhikari @SarthakAdhikari Yeap Actually it's the title.
Islam Ibakaev
@dagman
May 30 2016 12:22
hey guys just started my portfolio. click on Who to see cool animations. What do u think about it?
Adetunji Iyaniwura
@Iadetunji
May 30 2016 12:25
Connor Murphy
@papasmurph,ur work is cool,though u still need more professional touch,
shamieya
@shamieya
May 30 2016 12:29
@dagman It's definitely a unique idea. Haven't seen something like that before
Islam Ibakaev
@dagman
May 30 2016 12:31
@shamieya :smile:
very happy to hear it
Connor Murphy
@papasmurph
May 30 2016 12:31
@Iadetunji I'm open to suggestions?
Puja
@Pujachaubey
May 30 2016 12:33
hii frd i am doing codepen....
just have a look it is completed or not.
SarthakAdhikari
@SarthakAdhikari
May 30 2016 12:39
@LoicTouzard so what do I do with the title?
Adetunji Iyaniwura
@Iadetunji
May 30 2016 12:40
Connor Murphy
@papasmurph,u can try bootstrap and also try to make your social media button functional to fulfill the user story of the project............
Shusil Banjade
@shusil123
May 30 2016 12:41
@dagman , Man, It's cool .. Superb.
Islam Ibakaev
@dagman
May 30 2016 12:42
@shusil123 thx :smile:
CamperBot
@camperbot
May 30 2016 12:42
dagman sends brownie points to @shusil123 :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @shusil123 |http://www.freecodecamp.com/shusil123
Adam
@AdamTheWizard
May 30 2016 12:47
Hi guys... I cant get my page to show correctly in the editor. Its perfect in full page view but as soon as I go back to the editor it wont let me scroll down and the bottom section is cut off. It wont let me scroll down to continue working on it. my code is a mess but any help would be massively appreciated https://codepen.io/AdamTheWizard/pen/KMPGdX
SarthakAdhikari
@SarthakAdhikari
May 30 2016 12:51
@AdamTheWizard Its because of the black nav bar of the codepen website.. There is nothing wrong with the code
The bar with "console","shortcuts" blah blah is blocking the view. So don't worry with that
Adam
@AdamTheWizard
May 30 2016 12:53
@SarthakAdhikari It was my navbar. It didn't have the closing tag on it but its all sorted now, Thanks though.
CamperBot
@camperbot
May 30 2016 12:53
adamthewizard sends brownie points to @sarthakadhikari :sparkles: :thumbsup: :sparkles:
:cookie: 346 | @sarthakadhikari |http://www.freecodecamp.com/sarthakadhikari
Connor Murphy
@papasmurph
May 30 2016 12:56
@Iadetunji what?....
Milad
@gitemin2pac
May 30 2016 13:02
Hey guys.. need help in the Tribute Page project
NewtonXu
@NewtonXu
May 30 2016 13:45
For the twitch.tv api. Does anyone have a way to check if streamer is online and obtain all the streamer's information at the same time?
From what I understand I first have to use channel to check if theyre online, then use another page to obtain their information if theyre offline, what can I do?
greg
@wearenotgroot
May 30 2016 13:46
@NewtonXu short answer: no
NewtonXu
@NewtonXu
May 30 2016 13:46
@wearenotgroot thanks :P
CamperBot
@camperbot
May 30 2016 13:46
newtonxu sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1063 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
Stephen James
@sjames1958gm
May 30 2016 13:46
@NewtonXu I have only seen two requests when the user is offline - stream then channel
greg
@wearenotgroot
May 30 2016 13:47
@NewtonXu you need to use /stream to check if the channel is online, and /channel to get the info(accounts that are close will throw an error with code 422)
Ken Haduch
@khaduch
May 30 2016 13:49

@Joshuaswift - hello there. Not sure how much I can help right now, but I'll give you a couple hints and see if you can make some changes.

  • first of all, CodePen uses a template that already has the <head>, <body> and <html> tags in it. You should not use those tags in your HTML panel, it will result in invalid HTML.
  • next - it is more standard to write the HTML as <div class="container"> - without all of the embedded spaces, although I think it works either way. It is just strange to see it that way
  • I would recommend not making changes to the bootstrap classes in ways that would affect the layout - they already have been set up to work a particular way and trying to change the "float", alignment, etc. should be done very carefully. If you need to put borders, etc. you can make those additions, most likely, but I would make separate classes and you can have multiple classes (space separated) in the class= attribute.

I'll try to check back in in a little while.

Tonye Iyalla
@tiyalla
May 30 2016 14:02
hey all, please check out my weather app. i would appreciate some feedback. i am yet to add the feature that allows you to change from fahrenheit to celsius on click but i will. also if anyone has good knowledge of sass and can provide some info on how to use mixin for my keyframes, i would appreciate that http://codepen.io/tiyalla/pen/vGowxG
greg
@wearenotgroot
May 30 2016 14:09
@tiyalla looks good
@tiyalla :smile:
Christian Todd
@chrstntdd
May 30 2016 14:11
@tiyalla That does look good. I just finished my weather app as well. I like how you have background images for the weather instead of an icon!
Islam Ibakaev
@dagman
May 30 2016 14:18
hey guys what about this http://codepen.io/dagman/full/VjwGLy/
Christian Todd
@chrstntdd
May 30 2016 14:22
thats a really cool concept. very interactive and dynamic!
Tonye Iyalla
@tiyalla
May 30 2016 14:31
thanks for your feedback @wearenotgroot @chrstntdd
CamperBot
@camperbot
May 30 2016 14:31
tiyalla sends brownie points to @wearenotgroot and @chrstntdd :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @chrstntdd |http://www.freecodecamp.com/chrstntdd
:star2: 1065 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
NewtonXu
@NewtonXu
May 30 2016 14:33
hey guys my twitch javascript is doing this weird thing, im using console.log to debug it but it appears that the script executes halfway into the for loop, then executes the stuff under it, then goes back into the for loop, im so confused what's happening at this point
Ken Haduch
@khaduch
May 30 2016 14:33
@tiyalla - wow, Tonye - that's a beautiful design for the weather app! I like the changing background pictures, really adds a lot of interest to the page. Sorry that I don't know anything at all about SASS. But that's really nice work on that app! Congrats!
@dagman - wow - you are really getting creative with that - nice!
Juwdohr
@Juwdohr
May 30 2016 14:35
Hey can someone check this out and let me know what you think, and if there is any errors (and possible solutions)?
http://codepen.io/juwdohr/pen/eZoNKB
NewtonXu
@NewtonXu
May 30 2016 14:44
@Juwdohr It looks nice, i tried 9 X 9 = - 6 and got NaN, is that supposed to happen?
Andy Becker
@athomasbeck
May 30 2016 14:44
anyone else getting this error when trying to use geolocation through codepen in chrome? getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
Juwdohr
@Juwdohr
May 30 2016 14:44
@NewtonXu No that is what I'm trying to figure out why that keeps happening?
Ken Haduch
@khaduch
May 30 2016 14:44
@papasmurph - Hello - not sure if anyone commented on your page, but I just tried to open it. It opened, but nothing really much got loaded. "imgur" does not permit cross-linking of photos / images from their site - check their terms and conditions. So none of the images loaded. The white text was small and hard to read against the light blue background - but I don't know if your font loaded properly? Maybe you haven't included that yet - add something to your CSS external resources, if it's a google font? Good luck!
Andy Becker
@athomasbeck
May 30 2016 14:45
it seems like a recent update to chrome requires a secure server for geolocation features but i dont konw how to do that in codepen
Ken Haduch
@khaduch
May 30 2016 14:45
@athomasbeck - there is a problem on newer versions of Chrome. People have switched to using http://ip-api.com for getting the location, since that works.
NewtonXu
@NewtonXu
May 30 2016 14:46
@Juwdohr it also happens if i dont enter anything at the beginning and just press -6=
Andy Becker
@athomasbeck
May 30 2016 14:47
@khaduch oh ok, thats perfect. I was going crazy trying to figure out how to fix it. Thanks for the help!
CamperBot
@camperbot
May 30 2016 14:47
athomasbeck sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1228 | @khaduch |http://www.freecodecamp.com/khaduch
Juwdohr
@Juwdohr
May 30 2016 14:47
@athomasbeck you need to use something besides the built in geolocation() as the openweathermap.org uses non secure.
@NewtonXu Ok so How do i fix that?
I am looking for a solution to that? for some reason the prevAns, when parseFloat() is called on it, it doesn't work.
Islam Ibakaev
@dagman
May 30 2016 14:51
@khaduch did about text were dynimac or it were static
Tonye Iyalla
@tiyalla
May 30 2016 14:53
@khaduch thank you for the detailed feedback! I appreciate it!
CamperBot
@camperbot
May 30 2016 14:53
tiyalla sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1229 | @khaduch |http://www.freecodecamp.com/khaduch
Connor Murphy
@papasmurph
May 30 2016 15:02
@khaduch Strange, images load fine for me in FF & edge
redixhumayun
@redixhumayun
May 30 2016 15:06
@kirbyedy How else do you obtain the value of the input from the text box?
Ken Haduch
@khaduch
May 30 2016 15:12

@papasmurph - I think that as long as you are logged in to imgur / cookies set up or whatever, it will work. It will just not allow you to use the images for people who aren't logged in, I think.
From their terms of service:

Also, don't use Imgur to host image libraries you link to from elsewhere, 
content for your website, advertising, avatars, or anything else that turns 
us into your content delivery network. If you do – and we will be the judge – 
or if you do anything illegal, in addition to any other legal rights we may have, 
we will ban you along with the site you're hotlinking from, delete all your 
images, report you to the authorities if necessary, and prevent you from 
viewing any images hosted on Imgur.com. We mean it.

so - probably not a good idea, and it does not work for the general visitor to your site...

Could someone see why my global variable becomes undefined in the second json call?
Ken Haduch
@khaduch
May 30 2016 15:18
@dagman - it was dynamic - looked at it in Chrome on windows...
@NewtonXu - possibly because you have var streamer declared within your for loop? I haven't investigated in detail, though. That looks suspicious. If you want a global, only use var streamer for the initial declaration, and then just streamer anywhere else.
Connor Murphy
@papasmurph
May 30 2016 15:21
@khaduch Ahhh I see. I only chucked them up their for use with codepen and it was the first image host to come to mind
NewtonXu
@NewtonXu
May 30 2016 15:22
@khaduch it still ends up becoming undefined inside the nested loop though
Ken Haduch
@khaduch
May 30 2016 15:22
@NewtonXu - I'll spend a few minutes looking at it in more detail - I'll reply when I either find something or have to stop looking...
NewtonXu
@NewtonXu
May 30 2016 15:24
@khaduch Thank you very much sir, its on line 21/22/23 where you can see it becomes undefined
CamperBot
@camperbot
May 30 2016 15:24
newtonxu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1230 | @khaduch |http://www.freecodecamp.com/khaduch
NewtonXu
@NewtonXu
May 30 2016 15:24
on line 21 it is defined, then inside the json call i console.log(streamer) and obtain an undefined variable
@khaduch http://codepen.io/NewtonXu/pen/jrOxoM?editors=0010
It appears i fixed it, i think it was a var issue like you mentioned
Ken Haduch
@khaduch
May 30 2016 15:29
@NewtonXu - okay, that's good... I'll stop looking, then... :)
NewtonXu
@NewtonXu
May 30 2016 15:29
do you know why my array might become an integer though?
Ken Haduch
@khaduch
May 30 2016 15:30
@NewtonXu - well, in one place in the code that I happened to be scrolling past, I see this: streamer = online[i];, so you are directly assigning some value to that variable - not sure what that value would be, but it might (and probably does) trash the value that is in the streamer variable?
I see that around line 40 and 46, at least in those places.
NewtonXu
@NewtonXu
May 30 2016 15:31
@khaduch Alright i will take a look, thank you for your help
CamperBot
@camperbot
May 30 2016 15:31
newtonxu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: newtonxu already gave khaduch points
Ken Haduch
@khaduch
May 30 2016 15:32
@NewtonXu - you're welcome... good luck with that project!
redixhumayun
@redixhumayun
May 30 2016 15:36

http://codepen.io/redixhumayun/pen/beGKLq?editors=1111

Hey, can anybody tell me why my console.log won't display what I'm trying to type into my input box?

Ken Haduch
@khaduch
May 30 2016 15:38
@redixhumayun - I think that you only have your console.log output statement one time in your code, not in a place that will be activated by any of the click functions?
greg
@wearenotgroot
May 30 2016 15:39
@redixhumayun also missing $
Ken Haduch
@khaduch
May 30 2016 15:40
@wearenotgroot - good catch! @redixhumayun - note that...
I misinterpreted that you want to see the output for each keystroke. Line 15, right in front of the ("#form-input")
redixhumayun
@redixhumayun
May 30 2016 15:40
@wearenotgroot Missing a $ where?
greg
@wearenotgroot
May 30 2016 15:41
@redixhumayun where the error is pointing line 15 i believe
redixhumayun
@redixhumayun
May 30 2016 15:42
it still won't give me the output on my console
I've tried moving the form event inside my click event
still nothing
greg
@wearenotgroot
May 30 2016 15:42
@redixhumayun you need to add listener to that textfield/input
redixhumayun
@redixhumayun
May 30 2016 15:43
@wearenotgroot What do you mean?
@wearenotgroot Sorry, i'm still pretty lost with input fields
greg
@wearenotgroot
May 30 2016 15:44
@redixhumayun if you want to activate the search while the user is typing then use
var yourTextfield = $("#form-input");
yourTextfield.on('input',someFunction);
redixhumayun
@redixhumayun
May 30 2016 15:47

$("#form-input").on("click", function(){
$("#form-input").val("");
});
$("#form-input").on("input", function(){
var input = $("#form-input").value();
console.log(input);
});

Like this?

greg
@wearenotgroot
May 30 2016 15:50
@redixhumayun almost
@redixhumayun the method/function is .val();
redixhumayun
@redixhumayun
May 30 2016 15:50

$("#form-input").on("click", function(){
$("#form-input").val("");
});
var data = $("#form-input");
data.on("input", function(){
console.log(data.val());
});

Okay, this works but it displays every keystroke

Anyway to get rid of that?
I tried displaying the console.log outside of the on click event but that doesn't display anythig
greg
@wearenotgroot
May 30 2016 15:53
@redixhumayun if you want to activate the search when the user hit enter key then you need to detect that keystroke, the code 13(enter key). you can use keydown, keypress or keyup
redixhumayun
@redixhumayun
May 30 2016 15:55
@wearenotgroot Okay, will try that out
Leow Wei Xiang
@boyboi86
May 30 2016 15:56
need help with my project http://codepen.io/Boyboi86/pen/yJBjye

can't seem get the search working

//search functionality
$('.form-control').on("keyup", function(){
var search=$(this).val().toLowerCase();
$('.player .name').each(function(){
var result= $(this).text().toLowerCase();
$(this).closest('.name')[search.indexOf(result) !== -1? show() : hide()];
});
});

Juwdohr
@Juwdohr
May 30 2016 16:01
Any help would be appreciated:
http://codepen.io/juwdohr/pen/rLNLLE
redixhumayun
@redixhumayun
May 30 2016 16:07

@wearenotgroot Hey, I have this code

$("#form-input").on("click", function(){
$("#form-input").val("");
});
var data = $("#form-input");
$("#form-input").on("input", function(){
//console.log($("#form-input").val());
$("#form-input").onkeypress = function(e){
if(!e) e = window.event;
var keyCode = e.keyCode || e.which;
if(keyCode === '13'){
console.log($("#form-input").val());
}
}
});

But, it won't display the output when i hit enter.

http://codepen.io/redixhumayun/pen/beGKLq?editors=0111

greg
@wearenotgroot
May 30 2016 16:16
@redixhumayun should be
var string="";
$(document).ready(function(){
  $(".fa-search").on("click", function(){
    $(".fa-search").animate({left:210}, 500);
    $("#form-input").fadeIn(1000);
    $(".escape").fadeIn(1000);
  });
  $(".escape").on("click", function(){
    $(".fa-search").animate({right:210}, 500);
    $("#form-input").fadeOut(1000);
    $(".escape").fadeOut(1000);
  });
  //remove the others and just use .keypress or keydown
      $("#form-input").keypress(function(e){
      var keyCode = e.keyCode || e.which;
      if(keyCode == 13){
        console.log('enter');
        console.log($("#form-input").val());
      }
      });


});
@redixhumayun anyways g2g. GL :+1:
redixhumayun
@redixhumayun
May 30 2016 16:18
@wearenotgroot I copy-pasted your code, but when I hit enter, it still just submits the form. Doesn't do anything else
@wearenotgroot Alright, thanks anyway man
CamperBot
@camperbot
May 30 2016 16:18
redixhumayun sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1066 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
May 30 2016 16:19
@redixhumayun remove the .on('input', ...)
redixhumayun
@redixhumayun
May 30 2016 16:20
@wearenotgroot Did that too
greg
@wearenotgroot
May 30 2016 16:20
it's working here
redixhumayun
@redixhumayun
May 30 2016 16:21
@wearenotgroot not sure why it won't work for me
greg
@wearenotgroot
May 30 2016 16:21
@redixhumayun any errors?
redixhumayun
@redixhumayun
May 30 2016 16:22
@wearenotgroot Okay, that's weird, there was a delay before it started working
@wearenotgroot No idea why
@wearenotgroot anyway, works now. thank you so much
CamperBot
@camperbot
May 30 2016 16:22
redixhumayun sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: redixhumayun already gave wearenotgroot points
greg
@wearenotgroot
May 30 2016 16:22
@redixhumayun np
Kenzo Mendoza
@KenzoM
May 30 2016 16:28
Hello all, I'm having trouble receiving API for my RandomQuote project
I get this error whenever I tried to send a request: XMLHttpRequest cannot load http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
At first, it was working fine but after few tinkering with my code, it stopped working
here's my code:
'''
$(document).ready(function(){
$("#getMessage").on("click",function(){
$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(json){
$("#quote").html(JSON.stringify(json));
});
});
});
'''
CamperBot
@camperbot
May 30 2016 16:31
:bulb: to format code use backticks! ``` more info
Kenzo Mendoza
@KenzoM
May 30 2016 16:31
$(document).ready(function(){
$("#getMessage").on("click",function(){
$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(json){
$("#quote").html(JSON.stringify(json));
});
});
});
```
sorry, let my try again...
$(document).ready(function(){
$("#getMessage").on("click",function(){
$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(json){
$("#quote").html(JSON.stringify(json));
});
});
});
sorry for the formatting, but for now I just want to see if I do receive the json and I'll tinker the rest later
Never mind! Found what was wrong! Those who are curious, I found it here: http://stackoverflow.com/questions/31440314/issue-with-codepen-and-jquery
Richard-Bowen
@Richard-Bowen
May 30 2016 16:43
Hi, Any comments on my code and can anyone tell me where I am going wrong with the show/hide of the online/offline status, would be much appreciated.http://codepen.io/bowenrd40/pen/MeWroe
abtak mustapha
@mustapha88
May 30 2016 16:47
hello every one
i'm asking for help
for getting respose ao ajax request on open weathermap api key?
i get mu key but it return error
Nguyễn Quốc Đại
@nqdai1992
May 30 2016 16:52
hello every one this my code
http://codepen.io/dainguyen1992/pen/XKWZBy
and i have a problem i can remain form button tweet. I make button follow this link
https://about.twitter.com/vi/resources/buttons#hashtag
but i don't understand code in page and i can fix it.
Anybody help please :D
any one take a look and tell what's wrong with it?
Juwdohr
@Juwdohr
May 30 2016 17:09
Needing some help not sure where it goes wrong:
http://codepen.io/juwdohr/pen/eZoNKB
Shivam
@shvbzt8
May 30 2016 17:15
<li><a href="#" class="scrollable"> Contact</a></li> ... what does the "scrollable" class do.
Jake
@Jaketh
May 30 2016 17:16
those last two questions were so non-descript. you're going to have to be way more specific
@shvbzt8 good question. are you using bootstrap?
abtak mustapha
@mustapha88
May 30 2016 17:17
someone?
Jake
@Jaketh
May 30 2016 17:18
@mustapha88 sorry I haven't done the weather api problem yet. maybe ask the javascript channel?
@shvbzt8 look at the .css file, find where it says scrollable and it will tell you what css is being applied to that class. If it isn't in the regular file. then it is in one of the library files linked. If you want to lookinto the library files, its best to grab an un-minified version to look through.
abtak mustapha
@mustapha88
May 30 2016 17:20
@Jaketh oki no probleme
Leow Wei Xiang
@boyboi86
May 30 2016 17:21
sup
@mustapha88 ya?
Eric Murta
@murtinha
May 30 2016 17:23
Guys, whats the right way to use rowIndex and cellIndex? I need to know where the user clicked to be abble to mark an X or an O at that place...
http://codepen.io/murtinha/pen/VaJmgM?editors=0010
abtak mustapha
@mustapha88
May 30 2016 17:23
@boyboi86 i'm asking for making request with ajax to fetch data on openweathermap api key but it's return me error
Shivam
@shvbzt8
May 30 2016 17:27
Ok thanks
@mustapha88 thanks
CamperBot
@camperbot
May 30 2016 17:27
shvbzt8 sends brownie points to @mustapha88 :sparkles: :thumbsup: :sparkles:
:cookie: 326 | @mustapha88 |http://www.freecodecamp.com/mustapha88
Leow Wei Xiang
@boyboi86
May 30 2016 17:32
@mustapha88 show me what u have?
@mustapha88 don't use navigator.geolocation
it doesn't work
abtak mustapha
@mustapha88
May 30 2016 17:34
@boyboi86 it's return exactly the right location of user but error on data of weather
Leow Wei Xiang
@boyboi86
May 30 2016 17:34
give me your pen link
Feedbacks are greatly appreciated http://codepen.io/Boyboi86/full/yJBjye
@mustapha88 ok your first problem is data transfer you are requesting XMLhttpsRequest
so it must be done over HTTPS but codepen.io is HTTP only
so rejected
abtak mustapha
@mustapha88
May 30 2016 17:39
@boyboi86 working perfectly and great design also you represnted channels in horizontales way very creative so well done
Jake
@Jaketh
May 30 2016 17:39
@boyboi86 I like your lay out, its a cool idea. but you'll really need to make it responsive to smaller and larger screen sizes. I'm looking at it on a 30 inch screen and its pretty broken.
Juwdohr
@Juwdohr
May 30 2016 17:40
Needing some help figuring out why I keep getting NaN:
http://codepen.io/juwdohr/pen/eZoNKB
Leow Wei Xiang
@boyboi86
May 30 2016 17:40
@mustapha88 @Jaketh thanks. Anyways y
CamperBot
@camperbot
May 30 2016 17:40
boyboi86 sends brownie points to @mustapha88 and @jaketh :sparkles: :thumbsup: :sparkles:
:cookie: 327 | @mustapha88 |http://www.freecodecamp.com/mustapha88
:cookie: 287 | @jaketh |http://www.freecodecamp.com/jaketh
Jake
@Jaketh
May 30 2016 17:40
@Juwdohr how can we reproduce the error.
Leow Wei Xiang
@boyboi86
May 30 2016 17:41
@mustapha88 your biggest problem is you are requesting data which you are not given access to.
@mustapha88 that is why your Ajax error pop up
Juwdohr
@Juwdohr
May 30 2016 17:41
@Jaketh any time the Ans key or if you try doing an operation before inputing a number.
abtak mustapha
@mustapha88
May 30 2016 17:42
@boyboi86 yes but how can i make it an http request
Leow Wei Xiang
@boyboi86
May 30 2016 17:42
@mustapha88 so what you can do to supercede this problem try what I did. go get user ip address then use the ip address to get weather app details. So you will be using another method rather then geolocation.
Jake
@Jaketh
May 30 2016 17:43
oh. just check if a number has been submitted, if it hasn't, use event.preventDefault (look up the mdn documentation on hwo to use.) to prevent the event from firing
@Juwdohr
abtak mustapha
@mustapha88
May 30 2016 17:43
ok @boyboi86 thank's i well try it in moment
CamperBot
@camperbot
May 30 2016 17:43
mustapha88 sends brownie points to @boyboi86 :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @boyboi86 |http://www.freecodecamp.com/boyboi86
Leow Wei Xiang
@boyboi86
May 30 2016 17:44

you need to Ajax another website I will give you the link then you try. $.ajax({
url: 'http://ip-api.com/json',
data: {},
dataType: 'json',
Method: 'GET',
success: function(data) {
$city = data.city;
$('#location').html($city)

  setCurrent($city);

},
error: function(error) {
  console.log(error)
}

});

abtak mustapha
@mustapha88
May 30 2016 17:44
@boyboi86 thank you again for your time while you working on your project too so apperciate your help
CamperBot
@camperbot
May 30 2016 17:44
mustapha88 sends brownie points to @boyboi86 :sparkles: :thumbsup: :sparkles:
:warning: mustapha88 already gave boyboi86 points
Leow Wei Xiang
@boyboi86
May 30 2016 17:45
@mustapha88 use the code I put up to get city first then extract data from weather app site using their API
@mustapha88 np
NewtonXu
@NewtonXu
May 30 2016 17:53
This message was deleted
as you can see each container is generated but all of it contains the information of the last person
Randall Wyatt
@RandallWy
May 30 2016 18:10
I am needing help with my quote generator: http://codepen.io/RandallWy/pen/vKYbWY
I cannot get the quotes to return
Ken Haduch
@khaduch
May 30 2016 18:15
@RandallWy - make sure you have loaded jQuery.js. That doesn't fix everything, but it's a start... :)
NewtonXu
@NewtonXu
May 30 2016 18:20
@khaduch hey its me again, could you take another look at my code?
im referencing global variables but console is telling me my global variables are undefined
Ken Haduch
@khaduch
May 30 2016 18:21
@RandallWy - the next thing to do is to move your setup of the click handlers to the interior of the $(document).ready(function() { click handler setup here }
@RandallWy - and the next thing is to change your jQuery selectors from using ID selectors to class selectors, since you are targeting class-based elements, at least you've made "quote" be identified by class="quote"
@NewtonXu - okay - let me find it...
@khaduch
Pawan
@pawan92
May 30 2016 18:25
hey all working on twitch..so im trying to get the stream name to print and also print them on the next line..cant seem to figure it out. any tips?
http://codepen.io/pawan92/pen/MyMRwo?editors=1011
Ken Haduch
@khaduch
May 30 2016 18:27
@NewtonXu - why are you using window.streamer? (Maybe I just forget why you would use that?) Not sure that that's a problem, I just want to make sure that I know (or refresh the knowledge...)
NewtonXu
@NewtonXu
May 30 2016 18:27
@khaduch it takes the global variable right?
i just noticed everything was becoming undefined inside the getjson so i used globals
Ken Haduch
@khaduch
May 30 2016 18:28
@NewtonXu - that might be true, I've just never used that? I think I remember reading about it somewhere.
NewtonXu
@NewtonXu
May 30 2016 18:28
@khaduch im not sure though cuz its still undefined :(
Ken Haduch
@khaduch
May 30 2016 18:31
@NewtonXu @NewtonXu - let me spend a few minutes looking at it - I'll be back.
Elbert Cortez
@trip16661
May 30 2016 18:31
guys im trying to apply some styles to my project and I vertically and horizonatlly centered a div containing an imput and a h3 element
but when i increase the size of the of the font or add some marging btween eachother
the imput gets pushed down
is there any way to stop this vehaviour?
@khaduch btw i forgot to say thanks last time cuz i read it hours later :)
CamperBot
@camperbot
May 30 2016 18:31
trip16661 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1232 | @khaduch |http://www.freecodecamp.com/khaduch
Aquafina1
@Aquafina1
May 30 2016 18:38
hey i gotta question
in codepen how do you include libraries?
Ken Haduch
@khaduch
May 30 2016 18:39
@NewtonXu - there is something that happens when you use a for loop as you have to generate a lot of asynchronous operations. It has to do with the scope of the variable that you use to control your loop. It generates all of those requests, and at the end, the value of the variable i ihas been incremented to length + 1 of your array. So anything that is trying to use that value, such as the asynchronous returns from your requests, is going to be dumping the information into that location. It might be what is causing the problem here.
AaronCs
@AaronCs
May 30 2016 18:39
Hi guys, I'm doing the wikipedia viewer project, and I've been stuck on getting the random wiki page to work. Can someone help me or give me a hint? http://codepen.io/pineapplepencil/pen/qZLPyg
NewtonXu
@NewtonXu
May 30 2016 18:39
@khaduch oh i had noticed that it said 8 was undefined, but didnt realize it was from the for loop
Ken Haduch
@khaduch
May 30 2016 18:39
@Aquafina1 -what kind of libraries? If it is standard stuff like jquery.js, bootstrap.css, etc., there are places in the config setup for each panel to add them, and shortcut ways to add the most common ones.
Aquafina1
@Aquafina1
May 30 2016 18:40
bootstrap was what i was looking for
Ken Haduch
@khaduch
May 30 2016 18:40
@Aquafina1 - go to the CSS 'gear' icon, look in the quick add list for bootstrap, and just select it - it should populate one of the external resource slots.
Aquafina1
@Aquafina1
May 30 2016 18:41
oh, thanks ;D
Ken Haduch
@khaduch
May 30 2016 18:41
@Aquafina1 - you're welcome
Bruce Young
@mutantspore
May 30 2016 18:44
@AaronCs remove that callback bit in your api url. you miss-spelt datatype .. should be dataType and jsonp
http://codepen.io/MutantSpore/pen/OXJqYw?editors=1010
AaronCs
@AaronCs
May 30 2016 18:44
@mutantspore Thanks!
CamperBot
@camperbot
May 30 2016 18:44
aaroncs sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
Bruce Young
@mutantspore
May 30 2016 18:44
th edatatype bit deals with te jsop cross origins in ajax so no need for th ecallback
CamperBot
@camperbot
May 30 2016 18:44
:star2: 1664 | @mutantspore |http://www.freecodecamp.com/mutantspore
AaronCs
@AaronCs
May 30 2016 18:45
Oh okay I see
Bruce Young
@mutantspore
May 30 2016 18:46
@AaronCs I’m not sure what you intend to do…. there is a simple link that will get a random article (no coding required) . I did something lik you, got a random article, put the summary up and let the user choose if the want to view it.
AaronCs
@AaronCs
May 30 2016 18:48
I wanted to get to know APIs better so I'm gonna integrate it into the search part.
But now I feel really stupid because I didn't think of that
Bruce Young
@mutantspore
May 30 2016 18:48
@AaronCs that’s fine.. I did that also. Just making sure you knew the options
AaronCs
@AaronCs
May 30 2016 18:50
Oh hey that's cool. I think I might just do that
So for CORS, I just have to use jsonp?
Bruce Young
@mutantspore
May 30 2016 18:51
that’s what it’s for
AaronCs
@AaronCs
May 30 2016 18:51
Makes so much sense now. Thanks
Pawan
@pawan92
May 30 2016 18:54
@AaronCs for the random link..just create a button and create href link to the random link given in the project info. didnt look at your code but thats how i did it
Ken Haduch
@khaduch
May 30 2016 19:04

@NewtonXu - the first change I've made that is showing some results is to use the name value from the return json data to put the user information in the streamers array - this is the experimental change:

     $.getJSON(url1, function(data) {
        streamer.push(json.name);
        console.log('returned name = ' + json.name);
        streamer.push("https://www.twitch.tv/" + json.name);
        streamer.push(json["logo"]);
        streamer.push(json["game"]);

I took the Even though I cannot reload the page or I'll loose my changes, it is showing some names in the HTML. I might just fork this so I can continue saving.

NewtonXu
@NewtonXu
May 30 2016 19:05
@khaduch alright, thank you for your help. I'll try to do the rest on my own, since it is my project
CamperBot
@camperbot
May 30 2016 19:05
:star2: 1233 | @khaduch |http://www.freecodecamp.com/khaduch
newtonxu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Ken Haduch
@khaduch
May 30 2016 19:07
@NewtonXu - okay - basically, try to use the return json data to extract the information about the user and you'll be separated from that for loop variable problem. Good luck!
Marva
@Marva82
May 30 2016 19:36
I can't get my css to link over to my html console in codepen what am I doing wrong?
Toni Shortsleeve
@KoniKodes
May 30 2016 19:38
@Marva82 what is it doing?
Bruce Young
@mutantspore
May 30 2016 19:39
@Marva82 not sure what you mean but if you just put your CSS in your CSS codepen tab it will be available
Roy S
@rscheffers82
May 30 2016 19:46
Just finished my Wikipedia viewer, any feedback before I submit it is welcome :) http://codepen.io/roycode/full/VjZZvw
redixhumayun
@redixhumayun
May 30 2016 19:50

http://codepen.io/redixhumayun/pen/beGKLq?editors=0111

Can anybody tell me why the api won't output anything to the console in my code?

Bruce Young
@mutantspore
May 30 2016 19:52
@redixhumayun needs a callback . also there appears to be an incorrect search parameter if you look in the actual browser dev tools console
$.getJSON("https://en.wikipedia.org/w/api.php?action=query&titles=San_Francisco&prop=images&imlimit = 20&format=json&callback=?", function(json) {
redixhumayun
@redixhumayun
May 30 2016 19:53
@mutantspore Yeah, just included the callback. works now
Bruce Young
@mutantspore
May 30 2016 19:53
theimlimit has an error
redixhumayun
@redixhumayun
May 30 2016 19:53
Why is that an error though? That is just the maximum number of results right>
?
Bruce Young
@mutantspore
May 30 2016 19:54
spelt right?
ok you have some stray spaces in the url
Will Power
@restartedwill
May 30 2016 20:07
Posted to JS instead of this group. I'm working on the random quote generator. The issue is: I'm working for the first time in injecting text into a page. I made a div tag with an ID and am trying to add text to it in JS using : $("#this-content").html = "blah"; But the text doesn't appear in here. But I can append to the body, and it works. Any thoughts? I think I'm missing something simple here.
alpox
@alpox
May 30 2016 20:08
@restartedwill .html is a jquery function --> $("#this-content").html("blah");
Will Power
@restartedwill
May 30 2016 20:11
@alpox Unfortunately that still did not work. In my example, I'm trying to add the text "blah" to the div tag "this-content". This is possible, right?
alpox
@alpox
May 30 2016 20:12
@restartedwill Do you have a codepen to show?
Aryan
@aryandua
May 30 2016 20:12
Hey guys that is my code
One question...
Why does that thing not reset??
alpox
@alpox
May 30 2016 20:18
@restartedwill that is not your failure. You don't get any respond from the .getJSON. You connect to your codepen through https (secure) whereas you request the service with http (insecure). A secure connection does not allow insecure requests. The service you request does not provide a secure backend, so you have to connect to your codepen through http
Will Power
@restartedwill
May 30 2016 20:20
@alpox Ah, ok. I'll look for another random quote source then, as the example code from them were all http.
alpox
@alpox
May 30 2016 20:20
@restartedwill I'm not sure if there is a free one but its possible. I know from other services like openweather API that they only provide secure requests with payed plans
Will Power
@restartedwill
May 30 2016 20:21
@alpox Thanks for the help.
CamperBot
@camperbot
May 30 2016 20:21
restartedwill sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 666 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
May 30 2016 20:21
@restartedwill You're welcome
Jacob Bogers
@jacobbogers
May 30 2016 20:23
it is done, feedback please http://codepen.io/jacobBogers/full/NrWBPy/
NewtonXu
@NewtonXu
May 30 2016 20:25
hey guys im calling the twitch api to check if a channel exists, but if it doesnt exist, it wont let me get the json, what do i do?
Aryan
@aryandua
May 30 2016 20:26
@jacobbogers GReat!!
alpox
@alpox
May 30 2016 20:26
@NewtonXu I guess you check it in the kraken/streams endpoint
@NewtonXu You get the right channel data on the channels endpoint.
@NewtonXu Means, you have to do 2 calls. One for the channels endpoint to get the data and one for the streams endpoint to get the current status
NewtonXu
@NewtonXu
May 30 2016 20:29
@alpox i already do that to check if its online/offline, so i have a nested json call inside my json, what can i do?
will it always fail at one of the calls
Tzvetlin Velev
@tvelev92
May 30 2016 20:30
I have a question about <section> </section>
I have links that are going to point to sections on the same page
alpox
@alpox
May 30 2016 20:31
@NewtonXu If its offline, you don't get data from the streams endpoint, so you have to get it from the channels
Tzvetlin Velev
@tvelev92
May 30 2016 20:31
If I want to anchor to a section that needs to point here <A NAME="portfolio">
where does: <A NAME="portfolio"> get placed so that it anchors at the top of the section
Spatz
@Spatzerny
May 30 2016 20:34
@tvelev92 you can link to just id's
i think it's a better way to do this
no unnecessary tags cluttering about
Tzvetlin Velev
@tvelev92
May 30 2016 20:37
okay
but how would I do that with the anchor links
George Phalen
@gphalen
May 30 2016 20:39
Can anyone help with the Twitchtv project?
Spatz
@Spatzerny
May 30 2016 20:39
it would probably have to be placed as the first child or as sibling prior to it
rphares @rphares sees @Spatzerny , waves excitedly, and scurries back out :blush:
Spatz
@Spatzerny
May 30 2016 20:40
it's a little unelegant and its probably why you see linking to id's most of the time
Tzvetlin Velev
@tvelev92
May 30 2016 20:41
im having trouble getting my menubar clicks to go to the appropriate <section>
Spatzerny @Spatzerny waves at @rphares as she flaps her flappy wings by
NewtonXu
@NewtonXu
May 30 2016 20:43
@alpox im just getting an error when i access stream, but it should return a json file with the error shouldnt it? as opposed to just giving me nothing?
seems to work ok
@tvelev92 maybe it's because you have a fixed nav on top
and it obscures the top of the sections
Islam Ibakaev
@dagman
May 30 2016 20:49
yo guys take a look at this and give your feedback http://codepen.io/dagman/pen/VjwGLy
alpox
@alpox
May 30 2016 20:49
@NewtonXu Do you have a codepen?
it looks like it just skips it when there's an error
alpox
@alpox
May 30 2016 20:51
@NewtonXu You mean the ones which are not on twich? (Anymore)
NewtonXu
@NewtonXu
May 30 2016 20:51
@alpox yes
Tzvetlin Velev
@tvelev92
May 30 2016 20:51
it is jumping to the bottom of the sections
not the top
NewtonXu
@NewtonXu
May 30 2016 20:51
they dont show up on the list, and none of the ocde executes
Tzvetlin Velev
@tvelev92
May 30 2016 20:51
anybody willing to take a looka at the code?
alpox
@alpox
May 30 2016 20:51
@NewtonXu Ahh okay thats another thing. You have to collect them in the json error. The callback you handle is the success callback
NewtonXu
@NewtonXu
May 30 2016 20:52
@alpox So add another function to it?
alpox
@alpox
May 30 2016 20:52
@NewtonXu $.getJSON(url, function(data) { ........ }).fail(function(err) { <Here is your error callback> });
Dennis Mul
@oppositive
May 30 2016 20:53
Hi people. I'm having a little hickup with Twitch.tv. Can't get my filter radio button working. Any ideas?http://codepen.io/oppositive/pen/QELxmQ
NewtonXu
@NewtonXu
May 30 2016 20:53
@alpox and err will be the failed json return?
alpox
@alpox
May 30 2016 20:54
@NewtonXu I don't think you get any json...
See:
https://api.jquery.com/deferred.fail/
Tyler
@Thiggs
May 30 2016 20:55
Hey all, I'm struggling just getting started on the Local Weather project. I thought a good place to start would be to have navigator.geolocation pull in latitude and longitude, but I can't even get that to work correctly. Any ideas or hints?
Dennis Mul
@oppositive
May 30 2016 20:55
I loop through elements by class and set their style.display (table-row or none). This doesn't hide the records I want to.
NewtonXu
@NewtonXu
May 30 2016 20:55
@alpox then what is err?
alpox
@alpox
May 30 2016 20:56
@NewtonXu Ah it seems you get some: .fail(function(jqXHR, textStatus, errorThrown){});
@NewtonXu There is an arguments list...
There is no proper declaration for these 3 arguments but you can log them and see what you get
Tyler
@Thiggs
May 30 2016 20:58
@dagman that looks pretty sleek! I love the way it jumps from element to element when you click.
Islam Ibakaev
@dagman
May 30 2016 20:59
@Thiggs :smile:
Dennis Mul
@oppositive
May 30 2016 20:59
@Thiggs I had the same problem. Apperently geoLocation is already deprecated / out of fashion. You can use an API to get the city or lat lon for the user's IP. I chose to use http://freegeoip.net/json/
Tyler
@Thiggs
May 30 2016 21:00
@oppositive Oh man, thanks a bunch! I would've spent way more time trying to figure that out!
CamperBot
@camperbot
May 30 2016 21:00
thiggs sends brownie points to @oppositive :sparkles: :thumbsup: :sparkles:
:cookie: 288 | @oppositive |http://www.freecodecamp.com/oppositive
Dennis Mul
@oppositive
May 30 2016 21:01
Nice one @Thiggs
C
@engineerwithoutfear
May 30 2016 21:11
@Thiggs I made a short tutorial for it here if you get stuck: http://codepen.io/engineerwithoutfear/pen/eZaMBv
yerevin
@yerevin
May 30 2016 21:13
hello can someone can tell me what is wrong with my loops? http://codepen.io/sirmmate/pen/ezYMYx?editors=0010
Dennis Mul
@oppositive
May 30 2016 21:16
@yerevin I'm not there yet. It's forbidden to even look at your pen!!! :smile:
Tyler
@Thiggs
May 30 2016 21:18
@engineerwithoutfear Thanks! Just saw your reply!
CamperBot
@camperbot
May 30 2016 21:18
thiggs sends brownie points to @engineerwithoutfear :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @engineerwithoutfear |http://www.freecodecamp.com/engineerwithoutfear
yerevin
@yerevin
May 30 2016 21:19
@oppositive u can easy go for it because i made such a big bugs there that u will get no spoilers from there :D
C
@engineerwithoutfear
May 30 2016 21:21
@Thiggs no problem :)
Isaac Pak
@pak11273
May 30 2016 21:22
anyone working on the wikipedia viewer or has finished it? I need your help..
you don't need an api key for the wikipedia site do you?
Dennis Mul
@oppositive
May 30 2016 21:26
@yerevin I took a quick look. it's more advanced than you think(!) so it does seem inappropriate to dive in. good luck with your endless loop... somebody else?
yerevin
@yerevin
May 30 2016 21:26
u dont need key
Bruce Young
@mutantspore
May 30 2016 21:27
@pak11273 did you add &callback=? to the end of your api URL if you are using getJSON?
Isaac Pak
@pak11273
May 30 2016 21:28
@mutantspore no. i don't see why you need that parameter?
Bruce Young
@mutantspore
May 30 2016 21:28
ok then
Isaac Pak
@pak11273
May 30 2016 21:29
@mutantspore i'm just going by their documentation. they say to use .ajax
yerevin
@yerevin
May 30 2016 21:30
@oppositive ye I know it is harder than i have made it already but i want to get first functionalities before getting more inside of it :)
Bruce Young
@mutantspore
May 30 2016 21:31
@pak11273 well if you use ajax do you have dataType: ‘jsonp’
Isaac Pak
@pak11273
May 30 2016 21:32
@mutantspore jsonp?
Toni Shortsleeve
@KoniKodes
May 30 2016 21:32
@Thiggs I'm using the weather underground api - with autoip so that it should pull up immediately. It has a lot of good info that can be used. I just need to get it fully functional on codepen now.
Isaac Pak
@pak11273
May 30 2016 21:32
@mutantspore i have queryData
Dennis Mul
@oppositive
May 30 2016 21:32
I'm almost done with Twitch, so a long way to go to Simon Says @yerevin
Bruce Young
@mutantspore
May 30 2016 21:32
@pak11273 ok are you looking at the errors in teh actual browser dev console?
@pak11273 to get better help and to stop guessing games, please post your pen.
Isaac Pak
@pak11273
May 30 2016 21:38
jeez, i don't even know what i wrote anymore lol. why jquery has to be so squirly??
@mutantspore yes plz help my code out, it's broken
@mutantspore i'm not getting access control. you sure i don't need an api key?
Jesse Neumann
@Jesse989
May 30 2016 21:41
any feedback pls? I just finished and am open to criticism.
http://codepen.io/Jesse989/pen/PzoNgm have to open it to see it btw
Bruce Young
@mutantspore
May 30 2016 21:41
@pak11273 you don’t and i keep telling you how to fix that
Isaac Pak
@pak11273
May 30 2016 21:42
@Jesse989 pretty cool dude. but it's raining clouds and it shouldn't be where my location is :)
@mutantspore you mean i just add callback?
Jesse Neumann
@Jesse989
May 30 2016 21:43
@pak11273 noooo dang ok...is it at least cloudy where you are?
Isaac Pak
@pak11273
May 30 2016 21:43
@Jesse989 no clouds lol, i'm in vancouver, wa
Bruce Young
@mutantspore
May 30 2016 21:43
@pak11273 wel lnow that i see you have 2 api calls fo rsom reason.. callback is good for getjson.. the other ..ajax needs the dataType set to jsonp
i’m trying to fix it
Jesse Neumann
@Jesse989
May 30 2016 21:44
@pak11273 so the locatioin is wrong too? it uses an ip lookup because the geolocation is broken with chrome 50
Pat Meehan
@PatMeehan
May 30 2016 21:45
Trying the very simple process of adding a photo to my tribute page in pen software. i'm on a chromebook if that's a factor... would rather use css than html for some reason too... thanks.
Toni Shortsleeve
@KoniKodes
May 30 2016 21:45
@Jesse989 It worked for me, but I do have some clouds...
Isaac Pak
@pak11273
May 30 2016 21:45
@Jesse989 no the location is okay i think, even my weather app says portland, or. i think that has to do with the remote ip.
Pat Meehan
@PatMeehan
May 30 2016 21:45
i've added this code to the html section <img src="prince-photo.jpg" alt="Prince, Baby">
Jesse Neumann
@Jesse989
May 30 2016 21:45
ok thanks @pak11273 and @KoniKodes I will check it out!
CamperBot
@camperbot
May 30 2016 21:45
jesse989 sends brownie points to @pak11273 and @konikodes :sparkles: :thumbsup: :sparkles:
:cookie: 277 | @konikodes |http://www.freecodecamp.com/konikodes
:cookie: 303 | @pak11273 |http://www.freecodecamp.com/pak11273
Isaac Pak
@pak11273
May 30 2016 21:46
@mutantspore omg. my code got duplicated somehow...
@mutantspore are you editing my code?
Bruce Young
@mutantspore
May 30 2016 21:47
@pak11273 yes trying to work it out and fix things
Isaac Pak
@pak11273
May 30 2016 21:48
@mutantspore ah i see. i removed the duplicate api call.
Bruce Young
@mutantspore
May 30 2016 21:50
@pak11273 look in the console for the results
http://codepen.io/MutantSpore/pen/rLNgep?editors=0110
Isaac Pak
@pak11273
May 30 2016 21:51
@mutantspore sweet! so we didn't need callback=? after all
Bruce Young
@mutantspore
May 30 2016 21:52
@pak11273 yes IF you had of used getJSON you would have needed a callback
but you wanted to use ajax.. so the dataType jsonp IS the same thing to deal with the CORS issue
when i suggested it I had no idea of how you were making the api call
Isaac Pak
@pak11273
May 30 2016 21:54
@mutantspore i never heard of jsonp datatype, i thought you were miss typing json
Bruce Young
@mutantspore
May 30 2016 21:55
oh boy ..
JSONP (as in "JSON with Padding") is a method commonly used to bypass the cross-domain policies in web browsers (you are not allowed to make AJAX requests to a webpage perceived to be on a different server by the browser). JSON and JSONP behave differently on both the client and the server.Oct 1, 2010
Isaac Pak
@pak11273
May 30 2016 21:57
@mutantspore so only when you have to use headers do you really need to use this jsonp? i didn't have to do this with my weather app...
Bruce Young
@mutantspore
May 30 2016 21:57
@pak11273 no because they allowed it ..it’s a server setting
@pak11273 nothing to do with the headers bit
Isaac Pak
@pak11273
May 30 2016 21:59
@mutantspore @sjames1958gm thanks, i guess i better check api docs about json before making requests!!
CamperBot
@camperbot
May 30 2016 21:59
pak11273 sends brownie points to @mutantspore and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1376 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1665 | @mutantspore |http://www.freecodecamp.com/mutantspore
Isaac Pak
@pak11273
May 30 2016 22:00
@mutantspore one more question. how are you able to read my code when i don't understand what the hell i wrote anymore??
Stephen James
@sjames1958gm
May 30 2016 22:00
@pak11273 It comes with experience.
Isaac Pak
@pak11273
May 30 2016 22:01
@sjames1958gm i'm kinda looking for some online tutorials on how to write good, clean, readable code. FCC doesn't really teach that.
Bruce Young
@mutantspore
May 30 2016 22:01
@pak11273 yes.. it can be tedious but I’ve been helping here for about 10 months or more so I have the hang of it. One reason I help is to improve my debugging and code reading skills
oh and yes to helpout my fellow campers and save whales etc too
Stephen James
@sjames1958gm
May 30 2016 22:02
@pak11273 Always be willing to throw out code to make it better
@mutantspore Really nice portfolio - I esp. like the end looking up at the stars.
Isaac Pak
@pak11273
May 30 2016 22:02
let me check his portfolio out too :)
Bruce Young
@mutantspore
May 30 2016 22:03
lol double meaning .. i have studied Astronomy and a sci-fi reference :)
Stephen James
@sjames1958gm
May 30 2016 22:04
@mutantspore I get it now. A little Sagan ref.
Bruce Young
@mutantspore
May 30 2016 22:04
:)
Isaac Pak
@pak11273
May 30 2016 22:04
@mutantspore sweet dude! Have you finished FCC already??
@sjames1958gm can i see your portfolio?
Bruce Young
@mutantspore
May 30 2016 22:05
no I stil have to finish my Calculator and Simon … they are both in various staes of disrepair. I’ve done other setions ahead of them though
Isaac Pak
@pak11273
May 30 2016 22:06
are you goings making a living as developers? @sjames1958gm @mutantspore
Stephen James
@sjames1958gm
May 30 2016 22:07
@pak11273 For about 36 years now
Isaac Pak
@pak11273
May 30 2016 22:07
@sjames1958gm nice. so what are my chances after finishing fcc?
Stephen James
@sjames1958gm
May 30 2016 22:07
@pak11273 My portfolio is horrid - I have no color sense, taking a design course on UDEMY
@pak11273 Good if you keep at it. The key is to learn from the challenges, not just pass them. Too many are getting to later challenges, having not learned fundementals such as using brackets for variables.
Bruce Young
@mutantspore
May 30 2016 22:08
@pak11273 I did for 30 years but haven’t worked since 2009 so I’m getting back ito it.
Patrick McCaffrey
@musedivision
May 30 2016 22:11
Using brackets for variables?
Stephen James
@sjames1958gm
May 30 2016 22:11
@musedivision When you reference an object property with a variable always use bracket notation.
Jake
@Jaketh
May 30 2016 22:15
@musedivision like a json object, when you try to go deeper, dot notation wont get you through if you're using a variable to access the next level down
Isaac Pak
@pak11273
May 30 2016 22:16
now i'm not following you guys lol... plz post an example
Patrick McCaffrey
@musedivision
May 30 2016 22:20
OK, so like
Isaac Pak
@pak11273
May 30 2016 22:21
@mutantspore check it dude:
http://codepen.io/pak11273/full/LZYqGX/
man it's so hard to center stuff in bootstrap...
Bruce Young
@mutantspore
May 30 2016 22:23
@pak11273 you’ll need to clear the results div before displaying new results as the are stacking up… do 2 searches and scroll down to see
Patrick McCaffrey
@musedivision
May 30 2016 22:24
So like, when you have objects inside a json object? --> employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
Isaac Pak
@pak11273
May 30 2016 22:25
@mutantspore dam! that's not a user story though..
Bruce Young
@mutantspore
May 30 2016 22:25
@pak11273 it’s the .prepend doing it. perhaps you intended that. Also the use of .prepend is changing the order of teh returned results and basically messing up the alphabetic sort
DC
@dctor
May 30 2016 22:26
This message was deleted
CamperBot
@camperbot
May 30 2016 22:26
find quote machine
nothing found
tell me what you guys think! its my pomodoro clock
Isaac Pak
@pak11273
May 30 2016 22:30
@tadake it's not working for me.
Bruce Young
@mutantspore
May 30 2016 22:33
@pak11273 use $("#results").empty(); instead of your $("#results”).html(); to clear the results div
use .append instead of .prepend
and fix the error in the HTML section in the results div .. you have </dvi>
Isaac Pak
@pak11273
May 30 2016 22:35
@mutantspore awesome! thanks. can you kinda walk me through how you came to this conclusion?
CamperBot
@camperbot
May 30 2016 22:35
pak11273 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: pak11273 already gave mutantspore points
Isaac Pak
@pak11273
May 30 2016 22:38
@mutantspore more specifically, did you already know what functions to use to fix this? or did you have to look them up?
Bruce Young
@mutantspore
May 30 2016 22:39
@pak11273 prepend puts thing pre .. before the previous.. you want append ...add after. so it keeps the order it was given to you..sorted.
.empty() will empty out the element you have selected . you had .html() .html(“”) would have worked like .empty() though. and the miss-spelling of div is a mistake lol
Isaac Pak
@pak11273
May 30 2016 22:40
@mutantspore i guess i need to spend more time learning functions too.
Bruce Young
@mutantspore
May 30 2016 22:40
@pak11273 i look up things all the time but I have learnt some stuff since I started HTML in 1994 lol
Jason Shoemaker
@kutsuya1
May 30 2016 22:40
@pak11273 I saw that you wanted to improve your code. Have you read Code Complete 2? search for: "free open study" code complete
Isaac Pak
@pak11273
May 30 2016 22:43
@kutsuya1 ok i will have a look see. but i like have no time to read books right now, unless it's the holy grail of web development :)
@kutsuya1 if it honestly can help write better code at my level(beginner) and not be way over my head, then I will try it
@kutsuya1 thanks for the recommendation though. do you recommend this book? @mutantspore
CamperBot
@camperbot
May 30 2016 22:44
pak11273 sends brownie points to @kutsuya1 and @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: pak11273 already gave mutantspore points
:cookie: 366 | @kutsuya1 |http://www.freecodecamp.com/kutsuya1
Jason Shoemaker
@kutsuya1
May 30 2016 22:47
@pak11273 It's been a while since I read it, but it has been recommended before...and it's available for free. I'll probably read it again for ideas.
Isaac Pak
@pak11273
May 30 2016 22:48
@kutsuya1 i didn't see a free version. can you send me a link to that plz?
Bruce Young
@mutantspore
May 30 2016 22:48
@pak11273 the thing with a book is that hopefully the author has covered things properly in a decent order with not too many gaps or leaps. Studying stuff by yourself you tend to have huge gaps, and end up with a very incomplete view of things. You also tend to just skip or ignore bits that seem to hard.
Isaac Pak
@pak11273
May 30 2016 22:50
@mutantspore i want to get through this bootcamp though. It's like taking all of my time!
@mutantspore and this chat has helped me a bunch to understand stuff
Bruce Young
@mutantspore
May 30 2016 22:51
@pak11273 yes but at the end you want to have learnt something? not just “got through it"
Isaac Pak
@pak11273
May 30 2016 22:53
@pak11273 this gitter thing is giving me lots good learning i think. i try to solve whatever issues i think i can when someone posts. even though its very slow right now
ok the contents look really good, but dam its a big book!
Jason Shoemaker
@kutsuya1
May 30 2016 22:56
@pak11273 less than a 1000 pages. ;)
Isaac Pak
@pak11273
May 30 2016 22:56
god dam. i have like 5 udacity courses i need to go through, a couple of edx courses, codeacademy, udemy, FREAKIN NEVER ENDS
Jason Shoemaker
@kutsuya1
May 30 2016 22:57
@pak11273 yes, CS is like the medical & legal fields.....the learning never stops
Isaac Pak
@pak11273
May 30 2016 22:59
@kutsuya1 i think i will commit to this book though, it looks like it solves the issues i'm having
Jason Shoemaker
@kutsuya1
May 30 2016 23:00
@pak11273 Me too, you helped me recall it. Need to review it again.
Kyle Scott
@Hogall
May 30 2016 23:28
Does anyone have a moment to take a look at this post on front end help and see if anything jumps put at them. Ive been stuck all afternoon looking for a solution. Not sure what I am missing. http://forum.freecodecamp.com/t/assistance-needed-tribute-project-fadetoggle-on-divs-cause-page-to-jump-to-top-mobile/6379/1