These are chat archives for FreeCodeCamp/HelpFrontEnd

20th
Sep 2016
Nicole Horn
@N1CKL3
Sep 20 2016 00:01
Okay guys. I am working on the tribute page project. I have literally worked on it all day. I'm no where near finished but tell me what you think of it so far. Please and thank you!
Stephen Suratos
@stephenfs
Sep 20 2016 00:03
@N1CKL3 Looks good to me!
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:05
Yea it looks great so far Nicole! @N1CKL3
Nicole Horn
@N1CKL3
Sep 20 2016 00:05
@SteveAmaki Thanks! This project has made me want to flip tables all day but seeing it now makes it all worth it. I am so proud of the time and effort I put into it and I'm only half done. Coding is super rewarding.
CamperBot
@camperbot
Sep 20 2016 00:05
n1ckl3 sends brownie points to @steveamaki :sparkles: :thumbsup: :sparkles:
:cookie: 127 | @steveamaki |http://www.freecodecamp.com/steveamaki
Nicole Horn
@N1CKL3
Sep 20 2016 00:05
@jamesscruggs Thanks!
CamperBot
@camperbot
Sep 20 2016 00:05
n1ckl3 sends brownie points to @jamesscruggs :sparkles: :thumbsup: :sparkles:
:cookie: 268 | @jamesscruggs |http://www.freecodecamp.com/jamesscruggs
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:07
@N1CKL3 It is super rewarding! Hard to see that when you're banging your head trying to figure something out but it always ends up being worth it
Stephen Suratos
@stephenfs
Sep 20 2016 00:08
@N1CKL3 Im glad you find it all worth the time! Thats the right attitude. There's a reason why this industry's pay can be rewarding. If it was easy, that woudn't be the case.
]
and money is just tip of the iceburg
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:10
Does anyone know of a good way to collect quotes for the Random Quote Machine Project?
Stephen Suratos
@stephenfs
Sep 20 2016 00:10
coding will connect you to very intellectual and passionate people
Nicole Horn
@N1CKL3
Sep 20 2016 00:11
@SteveAmaki @jamesscruggs Absolutely! This chat and Free Code Camp in general is super supportive, too. It's nice knowing you have a ton of people who are willing to help you out and are friendly, especially when you think your brain is about to implode
Stephen Suratos
@stephenfs
Sep 20 2016 00:11
hahaha yep
On top of all these online learning, thinking and breathing code helped me get in the right mindset.
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:12
is there an easy way to copy these into divs? Or do I have to do this the hard way? XD
Stephen Suratos
@stephenfs
Sep 20 2016 00:12
also attending local meetups
@jamesscruggs Im not sure.. hehe
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:13
poo
Stephen Suratos
@stephenfs
Sep 20 2016 00:13
@jamesscruggs Let me know when you crack the code. Would definitely love to know.
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:14
LOL. I think I might try to make the quote machine geared towards hip hop lyrics. Huge hip hop fan here
Stephen Suratos
@stephenfs
Sep 20 2016 00:15
The truth is, even pro developers spend sleepless nights at times figuring out how to solve a problem
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:15
Just trying to think of an efficient way to get the quotes
Stephen Suratos
@stephenfs
Sep 20 2016 00:15
@jamesscruggs ah I see
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:17
Ugh don't say that @SteveAmaki XD
Ik you're right though..
Do you work in the industry yet?
Stephen Suratos
@stephenfs
Sep 20 2016 00:18
@jamesscruggs Somewhat... I'm a graphic designer. I work with developers/coders
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:20
That's pretty cool
Stephen Suratos
@stephenfs
Sep 20 2016 00:20
It's a fun atmosphere.
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:22
Yea one of my buddies works in the field and I would visit him during my lunch breaks and all the developers always seemed so damn happy compared to the other departments. One day I figured I'd check it out and see what the hype is all about.. Haven't looked back since
Stephen Suratos
@stephenfs
Sep 20 2016 00:23
Yep. There's frustrating time ofcourse with deadlines and stuff.. but it doesnt outway the fun.
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:24
Always annoying.. Gotta love deadlines!
So do you want to get into front-end stuff or just stay a graphic desinger?
Stephen Suratos
@stephenfs
Sep 20 2016 00:25
on top of that, there's a lot companies that hire remote workers. You can work from home at a cofee shop..
Lydia Larae
@nevaIsDreaming
Sep 20 2016 00:25
hey everybody! is there anyone hanging out here right now that has done the weather challenge yet?
Stephen Suratos
@stephenfs
Sep 20 2016 00:25
and they provide all the tech you need.
@nevaIsDreaming havent done it.
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:26
haven't made it that far yet @nevaIsDreaming
Stephen Suratos
@stephenfs
Sep 20 2016 00:26
@jamesscruggs I want to focus on UX and UI
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:26
sorry
Lydia Larae
@nevaIsDreaming
Sep 20 2016 00:26
@SteveAmaki do you know details about remote workers? do they earn at the same level as people who actually go in to work?
Stephen Suratos
@stephenfs
Sep 20 2016 00:27
I think my background in Visual Design helps
there's a site called flexjobs.com. It not free.. but they have remote job postings all the time.
Lydia Larae
@nevaIsDreaming
Sep 20 2016 00:27
@SteveAmaki @jamesscruggs no problem. I think I get what I'm doing but I was hoping someone could confirm that i'm on the right track
Stephen Suratos
@stephenfs
Sep 20 2016 00:27
@nevaIsDreaming
Lydia Larae
@nevaIsDreaming
Sep 20 2016 00:28
oh. good. I'll have to check that out. thanks for the tip!
Stephen Suratos
@stephenfs
Sep 20 2016 00:28
yup
James E Scruggs III
@jamesscruggs
Sep 20 2016 00:28
Yea that sounds like front-end stuff to me. Your design sense will definitely help you out with that.
Im sure someone could help you out with the challenge if you keep checking back @nevaIsDreaming
Stephen Suratos
@stephenfs
Sep 20 2016 00:34
@nevaIsDreaming is it an HTML CSS question?
Cameron Burkholder
@Cameron-Burkholder
Sep 20 2016 01:30
I'm working on the pomodoro clock, and I am trying to use the setInterval() function to alter the time in my pomodoro section, but when I try to use that the page becomes unresponsive. Currently, I have it set up to alter the variables for time and break when + and - buttons are clicked, but I can't get the timer to not freeze my page.
Rachel Reinheimer
@glgirl28
Sep 20 2016 01:31
@N1CKL3 It's very simple and clean. The code looks neat. Looks great so far!
Salomon
@zarruk
Sep 20 2016 01:31
So I have been trying that after pressing the Tweet button, there is a pre-written tweet with the quote obtained. I have not been able to find out how to do this. My button includes the tittle of the page and although every time the "Get quote" button is pressed, the quote is given as the title of the page, such quote is not included in the tweet. Any ideas?
https://codepen.io/zarruk/pen/jrrbAB?editors=1010
Stephen James
@sjames1958gm
Sep 20 2016 01:36
@zarruk I had to delete the tweet element and rebuild for each new quote.
Stephen Suratos
@stephenfs
Sep 20 2016 01:36

Bled my eyeballs out tinkering on this code and I'm happy how its turning out! Check it out yall!

https://codepen.io/ssuratosjr/full/JRRAWJ/

Salomon
@zarruk
Sep 20 2016 01:37
@sjames1958gm are you sure that's the best alternative?
Stephen James
@sjames1958gm
Sep 20 2016 01:38
@zarruk No. I understand that you can use web intents that are supposed to be much easier.
https://dev.twitter.com/web/intents
Nathan Christensen
@nateac1
Sep 20 2016 01:40
@SteveAmaki That looks great, I con't wait to have such a diverse portfolio as you
Stephen Suratos
@stephenfs
Sep 20 2016 01:44
@nateac1 Im trying to get coding under my belt!
Stephen James
@sjames1958gm
Sep 20 2016 01:44
@Cameron-Burkholder You need to make your mins and seconds variable global and you need to stop the timer on reset.
Cameron Burkholder
@Cameron-Burkholder
Sep 20 2016 01:46
Thanks. Is it just stopTimer(pomodoro)? @sjames1958gm
CamperBot
@camperbot
Sep 20 2016 01:46
cameron-burkholder sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3389 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Sep 20 2016 01:47
@Cameron-Burkholder clearInterval is the function and the parameter is the return from setInterval
Cameron Burkholder
@Cameron-Burkholder
Sep 20 2016 01:48
What is the return of setInterval() @sjames1958gm
Alex Rapley
@arapl3y
Sep 20 2016 01:48
Hey guys, messing around with API-based random quote machine, having trouble with the tweet button, it only seems to be able to tweet the initial quote and doesn't obtain the value of following quotes, would any one have a sec to take a look?
Stephen James
@sjames1958gm
Sep 20 2016 01:48
@Cameron-Burkholder It is a reference to the timer that clearInterval understands, other than that I don't know
Rafael J. Rodriguez
@Rafase282
Sep 20 2016 01:48
hi
Stephen James
@sjames1958gm
Sep 20 2016 01:49
@arapl3y post a link
@Cameron-Burkholder I thought you had myVar = setInterval() or something like that.
Robert Ridley
@robertridley1988
Sep 20 2016 01:50

I have a div tag. When I try to get the value with jQuery, the console.log just returns nothing.

var getVal = $('#tempVal').val();
console.log(getVal);

How can I get the number that is between the tags?
Robert Ridley
@robertridley1988
Sep 20 2016 01:54

If I do the following, I just get NaN:

var getVal = $('#tempVal').val().toNumber();
console.log(getVal);

tbc13315
@tbc13315
Sep 20 2016 01:57
Hi everyone, I am working on the Twitch API and I have been having a lot of trouble and can't seem to get through it.
Rafael J. Rodriguez
@Rafase282
Sep 20 2016 01:58
Does anyone knows how I can make a site show 3 up to 3 images only and hide the rest, even if one of the images is removed because it didnt load?
Stephen James
@sjames1958gm
Sep 20 2016 01:58
@arapl3y You are adding a handler for every quote move your click registration outside your getQuote function
@robertridley1988 You can put a + in from of that to coerce to number
@robertridley1988
+"123"
123
@arapl3y Also, you may need to make the current quote value global
@tbc13315 Did you add the new client_id?
Alex Rapley
@arapl3y
Sep 20 2016 02:01
@sjames1958gm I moved the click registration out and the quotes stopped coming through strangely... I'll keep looking
@sjames1958gm by declaring var quoteText; etc.. before the getQuote function?
Stephen James
@sjames1958gm
Sep 20 2016 02:03
@arapl3y yes. probably move the shareTweet function out of the getQuote functoin as well
tbc13315
@tbc13315
Sep 20 2016 02:04
@sjames1958gm I was looking at that client id doc on TWITCH and was wondering if I can use that client id header within the $.getJSON or do I have to try making the function with $.ajax now?
Alex Rapley
@arapl3y
Sep 20 2016 02:05
@sjames1958gm No dice :( now it doesn't even read the first quote...
LPR-309
@LPR-309
Sep 20 2016 03:21
@tbc13315 You could change them to $.ajax or do $.ajaxSetup beforehand. $.ajaxSetup changes all ajax calls on the page though, so it's discouraged, but it should work for the purposes of that project
  • I should say it changes all get calls on the page, actually
greg
@wearenotgroot
Sep 20 2016 03:23

@tbc13315 well they also support it as url param so just append it

apiURL + '&client_id=yourkey'

or

$.getJSON(apiURL, {client_id:'yourkey'}).done(...).fail(...);

on $.ajax

$.ajax({
 url: apiURL,
 data: {client_id:'yourkey'},
...
})
.done(...)
.fail(...);
Warren
@warrenonline
Sep 20 2016 03:28
Has anyone seen an example of the Random Quote Machine without using JQuery ? I'm stuck on the Tweet button.
greg
@wearenotgroot
Sep 20 2016 03:51
@warrenonline what seem to be the problem?
Warren
@warrenonline
Sep 20 2016 03:59
Sorry I was chatting in 2 rooms. I got some help in the javascript room.
greg
@wearenotgroot
Sep 20 2016 03:59
yep i saw, whereever you get help faster is fine :)
greg
@wearenotgroot
Sep 20 2016 04:04
@warrenonline btw here is the quick fix for your issue. just remove the old tweet button and before you add the new one
function addText(obj) {

    var e  = document.getElementById('twitter-button');
    if(e.firstChild !== null) e.removeChild(e.firstChild);

    var author = obj.author.toString();
    var quote = obj.quote.toString();
    document.getElementById("random_quote").innerHTML = quote;
    document.getElementById("random_author").innerHTML = author;
  }
Justin Woodward
@jwoo92
Sep 20 2016 04:10
I am having an issue stopping any current function execution when switching my simon game to "off". does anyone have experience with this?
Cyril Alvarez Adriaansen
@caa1982
Sep 20 2016 04:23
This message was deleted
CamperBot
@camperbot
Sep 20 2016 04:23
:bulb: to format code use backticks! ``` more info
Cyril Alvarez Adriaansen
@caa1982
Sep 20 2016 04:23
This message was deleted
<input class="check" type="checkbox">

$(".check").click(function() {
if ($(this).checked){
  $("img").hide(); 
}else {
  $("img").show(); 
}
});
hi guys any ideas why it doesnt work?
greg
@wearenotgroot
Sep 20 2016 04:27
@caa1982 try
this.checked
Cyril Alvarez Adriaansen
@caa1982
Sep 20 2016 04:28
@wearenotgroot tks pal
I was going around in circle
make sense
greg
@wearenotgroot
Sep 20 2016 04:28
@caa1982 :+1:
Chad Powell
@cjpowellaz
Sep 20 2016 04:29
Hello all, working on the quote machine and it is taking me a looooong time. What is a good API to use? I have tried some from mashape but I don't understand how the URLs and keys work. What's a good starting point?
Chad Powell
@cjpowellaz
Sep 20 2016 05:04
@KevinAngga it looks like it does not need a key to use it, correct? I never know where that thing is suppose to go in the request.
Justin Woodward
@jwoo92
Sep 20 2016 05:40
I am having trouble exiting functions that are currently executing when I switch my simon game to off, any advice?
Sorin Ruse
@sorinr
Sep 20 2016 06:10
@jwoo92 probably you have a setinterval function. to stop it try to use clearinterval
Justin Woodward
@jwoo92
Sep 20 2016 06:17
Spring, it's not that. I used queue instead like this
Sorin Ruse
@sorinr
Sep 20 2016 06:17
@Rafase282 hi. try to use flex, flex-wrap, flex-base
Justin Woodward
@jwoo92
Sep 20 2016 06:18
$(this).addClass('blue-turn').delay(1000).queue(function(){
$(this).removeClass('blue-turn').dequeue();
}):
It's something like that.
Rafael J. Rodriguez
@Rafase282
Sep 20 2016 06:19
@sorinr for what? Also I solved all the issues I had.
Justin Woodward
@jwoo92
Sep 20 2016 06:19
I'm not at my computer at the moment.
Sorin Ruse
@sorinr
Sep 20 2016 06:20
@Rafase282 i just saw ur post on 3 by 3 pict showing. :) glad u solved it :+1:
Rafael J. Rodriguez
@Rafase282
Sep 20 2016 06:20
Thanks
You can see the issue when you turn on, start game and turn back off quickly.
Sorin Ruse
@sorinr
Sep 20 2016 06:38
@jwoo92 not for me. it stays on until you manually turn it of
Kevin Angga
@KevinAngga
Sep 20 2016 07:42
anyone gote problem with navigator.geolocation on codepen?
U-ways
@U-ways
Sep 20 2016 07:50
@KevinAngga Just making sure, are you using HTTPs connection? That might be the problem.
Kevin Angga
@KevinAngga
Sep 20 2016 07:51
@U-ways yes i use https and fix the problem.. haha thx for answering
CamperBot
@camperbot
Sep 20 2016 07:51
:cookie: 449 | @u-ways |http://www.freecodecamp.com/u-ways
kevinangga sends brownie points to @u-ways :sparkles: :thumbsup: :sparkles:
U-ways
@U-ways
Sep 20 2016 07:51
@KevinAngga Welcome goodluck!
Alexander Pawik
@Aleks1406
Sep 20 2016 08:08

Hi, I am currently working on the random quote machine. Can somebody tell me how to make the twitter button share the quote and author (not the link to my pen)?

http://codepen.io/Aleks1406/pen/gwpzQb

Problems are probably in line 17 & 18 in JS and line 12 in html.
Artur Arsalanov
@kurumkan
Sep 20 2016 08:17
Hi there ! Where can I share my react projects? Where can I find people for review?
Alexander Pawik
@Aleks1406
Sep 20 2016 08:20
anyone?
vínαч puppαl
@vinaypuppal
Sep 20 2016 08:23
@Aleks1406 Since you loaded Twitter widget you cant access your twitter-share-button from JS it will be replaced by iframe you can verify that in chrome dev tools. So use your own a tag style it as button and change its href in JS dynamically using http://twitter.com/share?text=your quote and author
@Aleks1406 or if you want to use Twitter widget then you may have to delete the tweet element and rebuild for each new quote.
Alexander Pawik
@Aleks1406
Sep 20 2016 08:27
thank you for the hint. I will try it :)
@vinaypuppal thank you
CamperBot
@camperbot
Sep 20 2016 08:27
aleks1406 sends brownie points to @vinaypuppal :sparkles: :thumbsup: :sparkles:
:cookie: 554 | @vinaypuppal |http://www.freecodecamp.com/vinaypuppal
vínαч puppαl
@vinaypuppal
Sep 20 2016 08:27
@Aleks1406 :+1:
Erick Delfin
@Nifled
Sep 20 2016 08:34
I need help with centering. I'm trying to center the p element on here: http://jsfiddle.net/52VtD/15265/
center vertically*
vínαч puppαl
@vinaypuppal
Sep 20 2016 08:39
@Nifled You can easily do with flex-box add below styles to your footer
footer {
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center; 
}
@Nifled it centres p horizontally and vertically
Erick Delfin
@Nifled
Sep 20 2016 08:42
@vinaypuppal I lowered the height to 50px and it isn't vertically centered anymore
vínαч puppαl
@vinaypuppal
Sep 20 2016 08:44
@Nifled well it works for me see here http://jsfiddle.net/tfcj6qmy/
Ruan
@ZAChuck13
Sep 20 2016 09:37
Hi there, I need help with margins/padding on multiple divs. I'm playing around with different layouts and want to have multiple divs and all their nested divs should have a max padding/margin on the left. At the moment only my first div with its nested divs have the correct layout, with the following divs the left margin/padding increases by about 10px. Eg, div1 left margin is 10px (which is correct), div2 increases to 20px, div3 increases to 30px and so on. What is the solution to prevent this increase?
Ruan
@ZAChuck13
Sep 20 2016 10:05
It looks like I've found a solution/workaround, by creating more "static" divs. After adding a width value I'm getting the results I want.
njwda
@njwda
Sep 20 2016 10:10
Hello guys, can anyone help me with my twitch viewer project?
Chris Cullen
@123xylem
Sep 20 2016 11:39

function newChoice(){
  ind=  [Math.floor(Math.random() * choices.length)];
  seq=choices[ind];
  return seq;
}


function cpuSeq() {
  count++;
newChoice();  //seq is the value of random choice element
   interval =
 setInterval(function() { 
     if(cSeq.length>=1){ for(i=0;i<cSeq.length;i++){
 //IF cpuSeq has notes in it... play them again before making new ones.
  audioF[cSeq[i].toLowerCase].play(); } }

 audioF[seq.toLowerCase()].play();  
    cSeq.push(seq);

     console.log(cSeq + cSeq.length, pSeq);
    newChoice();
  if(cSeq.length>=count){clearInterval(interval);
  cSeq=[];}
 }, 1000);
}
Can someone advise me how to make CpuChoice remember past choices in Cseq Array and so make the cPu choose past choices before using random choices???
Kartikeya Gupta
@kartikeya100
Sep 20 2016 13:42
1 curious question not directly related with anything here.........the template projects I have made in FCC or other templates which I have made have like 250-350 line but a simple webpage on the net has like 900lines of code.......whats happening there??
_
Robert Stone
@rjstone
Sep 20 2016 13:54
Are you talking about JavaScript or html when you say code?
Kartikeya Gupta
@kartikeya100
Sep 20 2016 13:59
@rjstone all of the html-css-js code
Sayed Afif
@sayedafif
Sep 20 2016 14:35
hey guys needed a bit of help for tic-tac-toe game. how do i return the value of a button. I mean to check the winner. i wanted to check whether the value of button is returned or not. only then can i work more on it.
http://codepen.io/sayedafif/pen/BLBzJo?editors=0011
This message was deleted
Simon Cordova
@gbsimon87
Sep 20 2016 14:39
Hey guys! I have been working on a small project inspired by some online course I was taking...
Take a look, any suggestions or ways to improve it would be great!
http://codepen.io/gbsimon87/pen/qaqdaA
Renee Harris
@maniacalkitten
Sep 20 2016 15:15

not sure if this is where i should ask this, but here it goes.
when i'm doing my portfolio page, i'm adding the collapse on my navbar for mobile, but my navbar is not opening.

here is my codepen: http://codepen.io/maniacalkitten/full/ORRVJB/

and i added the following in my CodePen settings:
jQuery
jQuery UI
Bootstrap

greg
@wearenotgroot
Sep 20 2016 15:20
@maniacalkitten add jquery first before anything else(if you already added it in that order then ok, but it's not showing on that pen)
@maniacalkitten ok now add bootstrap second and then hit run
Renee Harris
@maniacalkitten
Sep 20 2016 15:25
@wearenotgroot that did it! for some reason, i have a feeling i should have known that. lol thanks so much!!!
greg
@wearenotgroot
Sep 20 2016 15:25
@maniacalkitten :+1:
Renee Harris
@maniacalkitten
Sep 20 2016 15:27
@wearenotgroot thanks for solving that for me. probably explains why my other stuff i wanted to use wasn't working either.
greg
@wearenotgroot
Sep 20 2016 15:27
@maniacalkitten np, probably :smile:
Gunvant Sarpate
@GunvantSr
Sep 20 2016 16:08
Collapsible navbar not working in bootstrap :worried:
greg
@wearenotgroot
Sep 20 2016 16:09
@GunvantSr link the pen and let's have a look
Margaret
@Margaret2
Sep 20 2016 16:19
@gbsimon87 first of all, this is awesome! nice job!
I can't get the very top of the circles to display - they keep getting cut off. Not sure if you can fix that, or if that's just a Codepen problem. Also, i think you don't need the words "The Sun" because it is kind of obvious that it is the sun. So i would say either remove that label or add labels to the other planets as well for consistency
Simon Cordova
@gbsimon87
Sep 20 2016 16:21
@Margaret2 cheers! Will definitely take that advice as I had already removed the sun text haha
Margaret
@Margaret2
Sep 20 2016 16:21
:D
Simon Cordova
@gbsimon87
Sep 20 2016 16:21
I'm currently creating a function so that I get the correct average distances from the sun
Mind helping me out one second?
Margaret
@Margaret2
Sep 20 2016 16:22
haha, i could try :P
what do you need help with
Simon Cordova
@gbsimon87
Sep 20 2016 16:23
function planetInfo(name, distance, diameter) {
    this.name = name;
    this.distance = function(x) {
        var number = 40;
        return x * 40;
    };
    this.margin = function(margin) {
        return  ((distance - 5) / 2);
    };
}

var venus = new planetInfo("venus", 0.72, 0.949);
console.log(venus);
When I try to log venus, I get the name just fine, but the distance and margin values simply show up as 'function'
blob
This message was deleted
Margaret
@Margaret2
Sep 20 2016 16:25
hm ok i will play around with it in codepen really quick
Simon Cordova
@gbsimon87
Sep 20 2016 16:27
thanks :)
marsoln
@marsoln
Sep 20 2016 16:30
@gbsimon87 I thought u mean this
Simon Cordova
@gbsimon87
Sep 20 2016 16:32
@marsoln pardon?
marsoln
@marsoln
Sep 20 2016 16:32
function planetInfo(name, distance, diameter) {
    this.name = name;
    this.distance = diameter*40;
    this.margin =((this.distance - 5) / 2);
}
var venus = new planetInfo("venus", 0.72, 0.949);
console.log(venus);
You shouldn't declare distanceand margin as a function if you wanna a property
Simon Cordova
@gbsimon87
Sep 20 2016 16:33
@marsoln thanks a lot, that's exactly what I needed
:)
Margaret
@Margaret2
Sep 20 2016 16:34
@gbsimon87 just was going to post my solution, but @marsoln did it better :D
marsoln
@marsoln
Sep 20 2016 16:34
@gbsimon87 You are welcome :smile:
Nick
@ndousset
Sep 20 2016 16:34
is anyone around who could help me get some images to display horizontally?
marsoln
@marsoln
Sep 20 2016 16:35
@Margaret2 Thank you. :smile:
Jason Luboff
@JLuboff
Sep 20 2016 16:35
Its always possible
Amit Patel
@AmitP88
Sep 20 2016 16:35
hey guys, so I'm working on my portfolio site for mobile view (320px viewport) and I decided to add more scroll down buttons so that each one scrolls down to the immediate section below rather than just the next project image: https://amitp88.github.io/New-Portfolio/
Simon Cordova
@gbsimon87
Sep 20 2016 16:35
cheers @margaret2 nonetheless :)
Amit Patel
@AmitP88
Sep 20 2016 16:35
however, I'm running into problems such as the first scroll down button scrolls down to the last section of the page and the scroll down buttons on the project descriptions aren't showing up
I looked over my code and id's carefully and logically they should work fine, but they aren't
I'm stumped =/
also, please look at this site through dev tools on the lowest viewport (320px), as I'm developing this mobile first and the desktop view is a mess
Simon Cordova
@gbsimon87
Sep 20 2016 16:38
@AmitP88 your top scroll bottom is taking me all the way to the bottom
oh, you mentioned that, sorry
The reason it's taking you down there is because it's linking to the contact section
Amit Patel
@AmitP88
Sep 20 2016 16:40
but my id for that button is #p1 not #contact
marsoln
@marsoln
Sep 20 2016 16:40
@AmitP88 Your first scroll down button was nested by an '<a>' tag which href="#contact"which means direct to the element which id="contact" so that's the reason
Simon Cordova
@gbsimon87
Sep 20 2016 16:41
This message was deleted
shoot wrong paste
No, if you right click the button and go to inspect or firebug you will see it doesn't have an ID
its a span tag with a class of mouse
which is nested inside the link element with reference to contact a @marsoln stated
Amit Patel
@AmitP88
Sep 20 2016 16:43
scroll-1.png
oh hang on a sec, lemme double check
here's a link to my repo: https://github.com/AmitP88/New-Portfolio
I don't know why it's showing up like that on my site when in my repo I had it correct
Wendy Medeiros
@wendyr21
Sep 20 2016 16:48
for those that have made the pomodoro example. what did you use in order to get the circle to fill in.. trying to do canvas, but as soon as i get closer i get further again
marsoln
@marsoln
Sep 20 2016 16:49
@AmitP88 Oh my friend, i checked your site, and found some terrible things.
Amit Patel
@AmitP88
Sep 20 2016 16:49
@marsoln oh no =/
marsoln
@marsoln
Sep 20 2016 16:49
each of your project block has a sibling description block right?
Amit Patel
@AmitP88
Sep 20 2016 16:50
yeah
marsoln
@marsoln
Sep 20 2016 16:50
and you thought your scroll button should be in your project block
Amit Patel
@AmitP88
Sep 20 2016 16:50
originally I had it like that, but then I realized that each scroll button was skipping over each description section, which I thought would be confusing and inconvenient to the user
marsoln
@marsoln
Sep 20 2016 16:50
but you still has a copy in your description block, that's where the bug came from
Amit Patel
@AmitP88
Sep 20 2016 16:51
yeah, I had it like that so that each screen (both project image and project description) would have their own scroll down button
basically I want the user to be able to just scroll down to the immediate next section rather than just the next project
so the flow would go: project image (with title) -> project description -> next project image (with title) -> next project description
marsoln
@marsoln
Sep 20 2016 16:54
If you check your scroll buttons in the descriptions,and then you will found they are all in the same position -- which is where the top scroll button located. So they covered again and again,and the last one was the winner :worried:
I thought you may forget to add the position: relative to your .description class in your style sheet.
Amit Patel
@AmitP88
Sep 20 2016 16:58
ooooh I see
ok, lemme try that real quick =)\
marsoln
@marsoln
Sep 20 2016 16:58
That causes all the scroll buttons in your descriptions position:absolute are based on the parent element of the descriptions --- the body root.
Amit Patel
@AmitP88
Sep 20 2016 16:59
oh I see
I tried it btw and now it's working perfectly =D
man, I still have a ton to learn, and I still have to brush up a ton on JS and jquery lol
marsoln
@marsoln
Sep 20 2016 17:01
Good luck further.
Amit Patel
@AmitP88
Sep 20 2016 17:02
@marsoln thanks man, I really appreciate your help :)
marsoln
@marsoln
Sep 20 2016 17:02
@AmitP88 It's my pleasure.
Amit Patel
@AmitP88
Sep 20 2016 17:02
aww man, I thought that would give you brownie points. didnt work for some reason
@marsoln thank you :)
lol damn, I'm trying to give you brownie points
but not sure why it's not working. it worked before
marsoln
@marsoln
Sep 20 2016 17:04
@AmitP88 :smile: Never mind , i don't know what's the brownie points for anyway. Good luck.
Michael Davis
@mhdavis
Sep 20 2016 17:04
hey all: I'm having a problem with .jumbotron in bootstrap. I'm working in codepen.io but for some reason the background-image to my jumbotron isn't working
Amit Patel
@AmitP88
Sep 20 2016 17:04
@marsoln oh ok. lol well, I tried at least. thx man, have a good day :D
Michael Davis
@mhdavis
Sep 20 2016 17:04
anyone have any suggestions?
marsoln
@marsoln
Sep 20 2016 17:05
@AmitP88 It's 1 am here,i should go sleep,bye. If you still got any questions just send me a private chat,I will check it out morning.
Stephen Suratos
@stephenfs
Sep 20 2016 17:09
@mhdavis Wheres your coe
code
Michael Davis
@mhdavis
Sep 20 2016 17:10
@SteveAmaki does the chat work such that i can just copy/paste it and it will recognize it?
Stephen Suratos
@stephenfs
Sep 20 2016 17:10
Bled my eyeballs out tinkering with this code..Im pretty happy how it turned out!
http://codepen.io/ssuratosjr/full/JRRAWJ/

@mhdavis no wrap your code in between tic marks...
`

code here
`

three tic marks at the top and then another 3 to close
Michael Davis
@mhdavis
Sep 20 2016 17:12
''' <section class="jumbotron">
<div class="container">
<h2>insert thing here</h2>
</div>
</section>'''
lol my bad
Stephen Suratos
@stephenfs
Sep 20 2016 17:13
@mhdavis the tic mark is the one right by "1" key on your keyboard
Michael Davis
@mhdavis
Sep 20 2016 17:13
<section class="jumbotron"> <div class="container"> <h2>insert thing here</h2> </div> </section>
Stephen Suratos
@stephenfs
Sep 20 2016 17:13
..lol or atleast in a mac it is
that works too
Michael Davis
@mhdavis
Sep 20 2016 17:14
for some reason its all on one line
@SteveAmaki i can include the css for it too
Stephen Suratos
@stephenfs
Sep 20 2016 17:16
can you put it on codepen?
Michael Davis
@mhdavis
Sep 20 2016 17:16
yea thats where its on
Stephen Suratos
@stephenfs
Sep 20 2016 17:16
I have to leave my desk . Be right back. See if anyone else here can help
Michael Davis
@mhdavis
Sep 20 2016 17:16
should i just link it?
Stephen Suratos
@stephenfs
Sep 20 2016 17:17
yeah post the link to codepen
Stephen Suratos
@stephenfs
Sep 20 2016 17:21
@mhdavis delete the " > " in the comment section above the .jumbotron
...in the css editor
Michael Davis
@mhdavis
Sep 20 2016 17:22
that fixed it
hahah im sorry
it was such a small thing that i didn't even notice it
Stephen Suratos
@stephenfs
Sep 20 2016 17:22
lol.. it happens
Michael Davis
@mhdavis
Sep 20 2016 17:23
@SteveAmaki thank you very much
Stephen Suratos
@stephenfs
Sep 20 2016 17:23
Sure
@mhdavis go to
https://unsplash.com/ if you need higher res photos for free.
Michael Gee
@michaelgee22
Sep 20 2016 17:24
http://codepen.io/michaelg22/pen/vXLEma/?editors=1010 Can anyone figure out why the array that i pushed json objects to is showing in the console.log but the array.length = 0 and when I try to access elements in the array it is undefined
Michael Davis
@mhdavis
Sep 20 2016 17:24
@SteveAmaki thanks actually, thats super useful
Stephen Suratos
@stephenfs
Sep 20 2016 17:25
you're welcome!
Tyler Moeller
@TylerMoeller
Sep 20 2016 17:43
@michaelgee22 It's a scope issue. Your streamerData array is only visible inside your first success function. Pass the variable to another function to use it elsewhere.
Derek
@DTJ357
Sep 20 2016 17:57
Hi! Could someone help me figure out why my JavaScript code doesn't display the results on the screen? I've been trying to figure it out, but I don't know what is wrong with my code.
http://codepen.io/Code4Jesus/pen/LkXQRN?editors=1111
Stephen James
@sjames1958gm
Sep 20 2016 18:00
@DTJ357 #searches is inside random article which you remove on submit
@DTJ357 Also use placeholder="Type anything you want to look up." this for your input rather than value=
Derek
@DTJ357
Sep 20 2016 18:02
Thank you for your help, @sjames1958gm !
Stephen James
@sjames1958gm
Sep 20 2016 18:02
@DTJ357 Also html += "<div class='well'>"; change from = to += as is here to get all articles
@DTJ357 :+1:
Phanindra M
@PhaniMaddi
Sep 20 2016 18:07
I'm getting status as "online" for all the profiles.. CAn anyone check what the error is?
This message was deleted
Stephen James
@sjames1958gm
Sep 20 2016 18:15
@PhaniMaddi You are calling two asynchronous APIs in parallel and using a global object.
You need to call the second getJSON in the first ones callback to ensure order of operation.
Also move global data inside the function(i) function
Phanindra M
@PhaniMaddi
Sep 20 2016 18:16
@sjames1958gm I tried calling second getJSON in first one.. but I was not getting data of offline users
Stephen James
@sjames1958gm
Sep 20 2016 18:28
@PhaniMaddi Hmm, also data.stream === null it is stream that is null for offline
Phanindra M
@PhaniMaddi
Sep 20 2016 18:30
@sjames1958gm Thanks got it now
gs-developer
@gs-developer
Sep 20 2016 18:58
Looking for some reviews for my portfolio page front-end project: Can some one volunteer?
Nya
@Nyapal
Sep 20 2016 19:07
Hey guys! Does anyone know where to find out who the user story is supposed to be about? Or do I just choose any person? Thanks!
Stephen James
@sjames1958gm
Sep 20 2016 19:11
@Nyapal It is supposed to be a general user. How a user would interact with your site
Toni Shortsleeve
@KoniKodes
Sep 20 2016 19:26
@PhaniMaddi How did you get your client id to work? Mine comes back with a 400 Bad Result error.
Salomon
@zarruk
Sep 20 2016 19:53
can anybody help me here please? why isn't my Tweet button appearing in the page? https://codepen.io/zarruk/pen/jrrbAB?editors=1010
Jordan Bartholomew
@tourdejord
Sep 20 2016 19:58
I'll take a look Salomon
@zarruk I didn't use JS to implement my tweet button. I just used <a id="tweet-button" href="#"></a> in my html and then added JS to it. So I can't really help you on that one.
I'm pretty sure I had fa fa-tweet with the font-awesome plug in and also a target="_blank" in there as well.
Michiel
@MichielHuijse
Sep 20 2016 20:09
@zarruk I am busy with the same excersize. what api do you use?
Salomon
@zarruk
Sep 20 2016 20:14
@MichielHuijse look at DM
Jordan Bartholomew
@tourdejord
Sep 20 2016 20:14
Either your code is not right at all or you are using a form I don't really understand. It looks like your twttr is not defined on the JS sheet. When I implement anything into html from JS I always start with $ to call, lets say, ('container') and then use a method to like .css or .text or .html to move over what I want into my called option('container')
Michiel
@MichielHuijse
Sep 20 2016 20:14
@zarruk what is DM? :shipit:
Salomon
@zarruk
Sep 20 2016 20:16
@MichielHuijse direct message
Jordan Bartholomew
@tourdejord
Sep 20 2016 20:16
It looks like you got is @zarruk. What was the issue?
Salomon
@zarruk
Sep 20 2016 20:18
@tourdejord And how did you do for the tweet to contain the quote?
Jordan Bartholomew
@tourdejord
Sep 20 2016 20:22
@zarruk good question. I'll grab my pen. one second.

So I ended up making variables to define random a random quote and it's auther. Once I had those variables I added to the tweet text link like this.

("https://twitter.com/intent/tweet/?text="+ randomQuote + " " + randomAuthor);

Here's the pen if you'd like to take a look. Don't forget to like it.

http://codepen.io/tourdejord-1470883108/pen/yaNzJj?editors=0010

Salomon
@zarruk
Sep 20 2016 20:25
well, actually I am doing something simillar
@tourdejord oh, I see you put it in parenthesis
Stephen James
@sjames1958gm
Sep 20 2016 20:36
@zarruk Your code would be a lot easier to work with if you put the quotes in an array and used the random number as a array index.
A lot less duplication.
Igor Amidzic
@igoramidzic
Sep 20 2016 20:53

Can someone help me with my Javascript?
Here is my site: http://utilitan.com/randomcolor/javascriptPractice.html
I think you will see what the problem is, but:
1) The boxes are shifted over like 2px from the first (initial) box,
2) the rest of the boxes don't change color

http://codepen.io/anon/pen/kkLymk

Zachary Bennett
@zbennett10
Sep 20 2016 20:55
$.getJSON("api.openweathermap.org/data/2.5/weather?q=London&APPID=(myid)", function(json) {
  $("#location").html(JSON.stringify(json));


});
I'm trying to post all of the json for the city of london to an h3 tag with id="location" using jquery just to see if the API is working.. It's not working though. Any suggestions?
Salomon
@zarruk
Sep 20 2016 20:58
@sjames1958gm yes, you're right it would be simpler. but my problem is that i am not being able to have the quote in the tweet. please take a look at my code to see if you get any ideas on how to solve it! https://codepen.io/zarruk/pen/jrrbAB?editors=1010
Jamie Weston
@monotone2k
Sep 20 2016 21:00
@zbennett10 Have you actually entered your id or did you leave it as '(myid)'?
Zachary Bennett
@zbennett10
Sep 20 2016 21:00
@monotone2k i entered it
Jamie Weston
@monotone2k
Sep 20 2016 21:00
Are you using Chrome/Firefox?
Zachary Bennett
@zbennett10
Sep 20 2016 21:00
ive tried with both
Jamie Weston
@monotone2k
Sep 20 2016 21:01
Hit F12, keep the developer tools open and re-run your Pen. Check the network tab and see if there's a response from the API.
@zbennett10 What response do you get?
Zachary Bennett
@zbennett10
Sep 20 2016 21:04
its giving a 404 not found when it tries to load the api. I will try a new api key
Jamie Weston
@monotone2k
Sep 20 2016 21:04
404 won't be that the key is wrong. It'll be that it can't find the resource at all.
You'd normally get some kind of authentication failure if it was the key. Maybe a 403.
Zachary Bennett
@zbennett10
Sep 20 2016 21:04
oh ok
Well I'm copying and pasting from their example API calls, so i don't see what's wrong
Jamie Weston
@monotone2k
Sep 20 2016 21:06
When I copy/paste your link (minus the parameter for the key) I get a 401 (authorization required). Yours should work.
Zachary Bennett
@zbennett10
Sep 20 2016 21:06
haha so weird man! I know there's a reason though
Jamie Weston
@monotone2k
Sep 20 2016 21:06
What happens if you put http:// on the start?
Within $getJSON, that is.
Zachary Bennett
@zbennett10
Sep 20 2016 21:06
thats what does it man! Wow....
Jamie Weston
@monotone2k
Sep 20 2016 21:07
:)
Zachary Bennett
@zbennett10
Sep 20 2016 21:07
@monotone2k thanks! It's always the smallest things haha
Jamie Weston
@monotone2k
Sep 20 2016 21:07
Most languages will need you to specify the protocol. As humans, we know you meant a web resource... as a computer, it doesn't ;)
Zachary Bennett
@zbennett10
Sep 20 2016 21:08
right because it might be https as well?
Jamie Weston
@monotone2k
Sep 20 2016 21:12
Or SMTP. Or dozens of other things.
Zachary Bennett
@zbennett10
Sep 20 2016 21:12
@monotone2k thanks I really appreciate it
Jamie Weston
@monotone2k
Sep 20 2016 21:12
Most of the things of that list can be accessed using what looks like a web address, but using a different prefix :)
Stephen James
@sjames1958gm
Sep 20 2016 21:48
@zarruk
  $('.tweet-button iframe').remove();
  // Generate new markup
  var tweetBtn = $('<a></a>')
    .addClass('twitter-hashtag-button')
    .attr('href', 'https://twitter.com/intent/tweet?button_hashtag=freecodecamp')
    .attr('data-size', "large")
    .attr('data-text', quote.quote);

  $('.tweet-button').append(tweetBtn);

  twttr.widgets.load();
@zarruk this is what I did to replace the tweet with a new quote
Justin Woodward
@jwoo92
Sep 20 2016 21:51
I am having some trouble stopping the execution in actively running functions on my simon says game when I switch it to off. Does anyone have any advice on how to perform this properly?
nabzster
@nabzster
Sep 20 2016 21:51
Hello, I have this right now http://codepen.io/nabzster/pen/rrWjGz and it has a horizontal bar at the bottom. How can I get rid of this? This means that there is something going overflow right?
It's not the about text box and not the images either
Toni Shortsleeve
@KoniKodes
Sep 20 2016 21:54
@jwoo92 Are you using a clearInterval?
@nabzster Your intro-divider has a top and bottom border. Is this what is causing it?
nabzster
@nabzster
Sep 20 2016 21:57
@KoniKodes ill double check thanks
@KoniKodes it's not the intro-divider
somoking
@somoking
Sep 20 2016 22:00
hey can someone help me with some JS . Im trying to use [delete collections.id.prop ] id and prop are both variables though so im trying to understand how to include variables into dot matrix format
somoking
@somoking
Sep 20 2016 22:07
nvr mind
Trommelochse
@Trommelochse
Sep 20 2016 22:10
@nabzster you have overflow:hidden on your body, so you can't scroll anywhere
nabzster
@nabzster
Sep 20 2016 22:11
@Trommelochse How do i remove the unwanted horizontal scroll bar without anything disappearing
Amit Patel
@AmitP88
Sep 20 2016 22:12
hey guys, is my site good? https://amitp88.github.io/New-Portfolio/
:)
also feel free to check it across different devices
Justin Woodward
@jwoo92
Sep 20 2016 22:16
@KoniKodes I am not. some of the functions run off of setTimeout() and others include .queue() within them.
@KoniKodes my simon game
Trommelochse
@Trommelochse
Sep 20 2016 22:19
@AmitP88 you do have some nice ideas there
but I think your overall design is not well thought through
Amit Patel
@AmitP88
Sep 20 2016 22:20
@Trommelochse oh ok. what would you change?
Alexandro Pequeno
@Argestis
Sep 20 2016 22:26
Guys, does anyone one knows how to update the value of an input after clicking on submit?
http://codepen.io/argestis/pen/XjKQRA
I'm doing the wiki exercise but when I enter a new search in the input is not updating the value :C
Alexandro Pequeno
@Argestis
Sep 20 2016 22:33
T_T
somoking
@somoking
Sep 20 2016 22:45
hey im getting TypeError: collection[id].hasownproperty is not a function but its not suppose to be a function its a condition
the lin looks like // if (collection[id].hasownproperty("tracks"))
greg
@wearenotgroot
Sep 20 2016 22:45
@Argestis you dont really need to use submit. just move the $.getJSON inside that keydown event
and make sure to empty out the previous result before appending the next ones
@Argestis it can look like this
$('#watchaLookingFor').keydown(function(e) {

 if (e.which == 13) { //enter key detected

  $('.results').empty(); //empty out the results from previous

  var input = $('#watchaLookingFor').val(); //get the value from the input 

  $.getJSON('https://en.wikipedia.org/w/api.php?callback=?&action=query&list=search&srsearch=' + input + '&srwhat=text&srprop=snippet&continue=&utf8&prop=links&format=json', function(data) {
   for (var i = 0; i < data.query.search.length; i++) {

    $('.results').append('<article>' + '<h2><b>' + data.query.search[i].title + '</b></h2>' + '<p>' + data.query.search[i].snippet + '.</p>' + '</article>');
   }

  })
 }
});
Alexandro Pequeno
@Argestis
Sep 20 2016 22:50
WTF!
hahahaha
omg I been stuck here for the last 24 hours you got it in 3 seconds, LOL
OMG thank you! @wearenotgroot
greg
@wearenotgroot
Sep 20 2016 22:51
@Argestis :+1:
Alexandro Pequeno
@Argestis
Sep 20 2016 22:51
So why the .empty does not remove the current values? is that normal?
greg
@wearenotgroot
Sep 20 2016 22:52
@Argestis well on your current code you only really need to empty the previous results
$('#submit').submit(function() {
 $('.results').empty();

 return $.getJSON('https://en.wikipedia.org/w/api.php?callback=?&action=query&list=search&srsearch=' + document.getElementsByName('input')[0].value + '&srwhat=text&srprop=snippet&continue=&utf8&prop=links&format=json', function(data) {
  for (var i = 0; i < data.query.search.length; i++) {

   $('.results').append('<article>' + '<h2><b>' + data.query.search[i].title + '</b></h2>' + '<p>' + data.query.search[i].snippet + '.</p>' + '</article>');
  }

 })
});
@Argestis empty() removes all child nodes of that particular target element
Hassen Rmili
@hassenrmili
Sep 20 2016 22:54
@AmitP88 cool
greg
@wearenotgroot
Sep 20 2016 22:54
@Argestis did you want to clear the text in the input as well?
$('#watchaLookingFor').val(''); //clear the text in  input
Alexandro Pequeno
@Argestis
Sep 20 2016 22:54
got it, your awesome and again, thank you very much!
Should I use the same function targeting the input?
Daniel Combs
@DunderStruck
Sep 20 2016 23:04
Quick question. I'm working on the portfolio project and there's a gap between my container div and my navbar. I can't figure out how to get rid of it. http://codepen.io/dunderbutt2000/pen/MeyQVY Also ignore how bad everything looks, I'm going to style it up once I get the general outline finished
Salomon
@zarruk
Sep 20 2016 23:11
@sjames1958gm thank you but what happens if the quote is inside a variable?
Daniel Combs
@DunderStruck
Sep 20 2016 23:14
I think I solved my problem. I changed the navbar to fixed rather than static and that got rid of the gap. Not sure why it was there either way though
Salomon
@zarruk
Sep 20 2016 23:17
@sjames1958gm and anyways that code you gave me is not working :worried:
Justin Woodward
@jwoo92
Sep 20 2016 23:18
I am having trouble stopping a function execution by using return false. Would anyone like to assist me?
Trommelochse
@Trommelochse
Sep 20 2016 23:21
@jwoo92 let me se your function
*see
Justin Woodward
@jwoo92
Sep 20 2016 23:25
@Trommelochse my simon game. turn on, click start, then quickly turn off. my function continues to run instead of quitting at that moment. the code may not be my most current attempt, but it delivers the issue to you that is at hand.
@Trommelochse I just about have a solution.