These are chat archives for FreeCodeCamp/HelpFrontEnd

17th
Feb 2016
Kevin Mulligan
@kmulligan
Feb 17 2016 00:00
@morganmay Are you getting an error?
Bruce Young
@mutantspore
Feb 17 2016 00:01
@morganmay let’s see what you have in codepen
Kevin Mulligan
@kmulligan
Feb 17 2016 00:02
@mutantspore @mutantspore actually I am getting errors on codepen right now too
morganmay
@morganmay
Feb 17 2016 00:08
All I've got is what the tiutorial recommended so far. I took out the manually-added Bootstrap CDN code. http://codepen.io/morganmay/pen/bEJENN
Bruce Young
@mutantspore
Feb 17 2016 00:12
@morganmay if you put in BS first ..then animate. it should be ok. what are the errors.. the ones in console? you can see that bootstrap works by the styling of the H1 and the button
morganmay
@morganmay
Feb 17 2016 00:13

@kmulligan @mutantspore I got this error in Firefox:
16:03:52.695 Content Security Policy: The page's settings blocked the loading of a resource at self ("script-src http://codepen.io 'unsafe-eval' http://preprocessor.codepen.io http://*.pubnub.com https://*.pubnub.com http://platform.twitter.com http://connect.facebook.net http://www.google-analytics.com https://*.google-analytics.com https://*.google.com http://wufoo.com https://wufoo.com http://*.wufoo.com https://*.wufoo.com https://*.stripe.com https://*.instapaper.com http://*.instapaper.com http://dc8na2hxrj29i.cloudfront.net http://s3.buysellads.com http://srv.buysellads.com/ https://www.fullstory.com https://stats.buysellads.com http://stats.buysellads.com https://*.braintreegateway.com https://www.paypalobjects.com http://assets.codepen.io http://assets.codepen.io/ https://assets.codepen.io https://assets.codepen.io/ http://assets.cdpn.io").1 bEJENN

And this similar one in Chrome:
Refused to load the script 'data:application/javascript;base64,KGZ1bmN0aW9uKCkgewogICAgLy8gaHR0cHM6Ly9k…ogICAgZ2EucmVtb3ZlID0gbm9vcGZuOwogICAgd2luZG93W2dhTmFtZV0gPSBnYTsKfSkoKTs=' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' http://preprocessor.codepen.io http://*.pubnub.com https://*.pubnub.com http://platform.twitter.com http://connect.facebook.net http://www.google-analytics.com https://*.google-analytics.com https://*.google.com http://wufoo.com https://wufoo.com http://*.wufoo.com https://*.wufoo.com https://*.stripe.com https://*.instapaper.com http://*.instapaper.com http://dc8na2hxrj29i.cloudfront.net http://s3.buysellads.com http://srv.buysellads.com/ https://www.fullstory.com https://stats.buysellads.com http://stats.buysellads.com https://*.braintreegateway.com https://www.paypalobjects.com http://assets.codepen.io http://assets.codepen.io/ https://assets.codepen.io https://assets.codepen.io/ http://assets.cdpn.io".

Bruce Young
@mutantspore
Feb 17 2016 00:14
? well this is a fork of yours with BS added. @morganmay I’m using Safari/Mac
@morganmay looks like a list of sites you have blocked by an ad block program?
morganmay
@morganmay
Feb 17 2016 00:16
@mutantspore While testing it in Chrome I accidentally reverted to the version that had the manually-added CDN import.
Bruce Young
@mutantspore
Feb 17 2016 00:19
@morganmay so my fork of yours (above) doesn’t work for you? Ithink youhav esome sort of ad block plugin
morganmay
@morganmay
Feb 17 2016 00:19
@mutantspore Adblock was my first thought, but Bootstrap doesn't load even when I disable it or load it in Internet Explorer (which has no ad blocker installed).
Your fork works, though.
How did you add Bootstrap? Just through the options panel?
Bruce Young
@mutantspore
Feb 17 2016 00:20
wel all i did was put BS in the CSS before animate and save it
yes
I didn’t do anything else at all
morganmay
@morganmay
Feb 17 2016 00:24
Okay, I'm blind. Somehow I managed to remove Bootstrap from the CSS without noticing. Sigh. Thanks for your help!
Bruce Young
@mutantspore
Feb 17 2016 00:26
@morganmay ty for looking again and not just saying it doesn’t work!
morganmay
@morganmay
Feb 17 2016 00:26
Well thank you for being so patient...
Kaue Rodrigo Pacheco
@kauepacheco
Feb 17 2016 00:43
Im trying to add a color to a <h1> using bootstrap... Is it possible? Or I just use css? Because its a challenge to create a tribute page and it is supose to be using only html in codepen... Anyone?
Bruce Young
@mutantspore
Feb 17 2016 00:44
@kauepacheco bootstrap is CSSand yes it has it’s own color set. you can override it in CSS if you want to
Kaue Rodrigo Pacheco
@kauepacheco
Feb 17 2016 00:46
So I can't change color using a Bootstrap code inline? @mutantspore
Alright got it thanks man
Maddah Anass
@unlimiworks
Feb 17 2016 01:00
Hello guys
Victor Hernandez
@Theviajerock
Feb 17 2016 01:01
Hello
Maddah Anass
@unlimiworks
Feb 17 2016 01:01
Can i please get help on one of my api .getJSON calls ? I don't know why i don't get anything from that
http://codepen.io/UnlimiWorks/pen/WrWrLj
Victor Hernandez
@Theviajerock
Feb 17 2016 01:01
@UnlimiWorks You must add jquery on the javascript part.
I don't see it in there.
Maddah Anass
@unlimiworks
Feb 17 2016 01:02
Ow. Totally forgot that
Still not fixed though
Victor Hernandez
@Theviajerock
Feb 17 2016 01:09
I am searching....
I have the same problem
I am crazy..... Angry with that.
Owen Temple
@owentemp
Feb 17 2016 01:10
@mutantspore thanks! don't know how that got chopped. appreciate it!
CamperBot
@camperbot
Feb 17 2016 01:10
owentemp sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1137 | @mutantspore | http://www.freecodecamp.com/mutantspore
Maddah Anass
@unlimiworks
Feb 17 2016 01:11
@Theviajerock Are you using the same API ?
Victor Hernandez
@Theviajerock
Feb 17 2016 01:13
No
I am using the wikipedia API
But that Cross-Site thing confused me a lot...
Sometimes works with $.getJSON
And sometimes work with $.ajax
works*
Victor Hernandez
@Theviajerock
Feb 17 2016 01:20
@UnlimiWorks Replace the url with this one =
Maddah Anass
@unlimiworks
Feb 17 2016 01:20
yep, tried that
Victor Hernandez
@Theviajerock
Feb 17 2016 01:20
It works for me.
Bruce Young
@mutantspore
Feb 17 2016 01:21
@UnlimiWorks where are the docs for the api?
Victor Hernandez
@Theviajerock
Feb 17 2016 01:23
@UnlimiWorks I change the url like that, click at the button and it works correctly.
Maddah Anass
@unlimiworks
Feb 17 2016 01:23
I transitioned to using "http://quotesondesign.com/wp-json/posts" which uses a new version of the API. And also get only 1 JSON quote instead of everything.
@mutantspore The 'docs' are stated here : http://quotesondesign.com/the-api/
I think i need o specify some parameters to randomize
here's the link for the 4.0: http://quotesondesign.com/api-v4-0/
Maddah Anass
@unlimiworks
Feb 17 2016 01:25
The problem with this specific API is that i'm not getting all the quotes even if i'm not filtering them
Victor Hernandez
@Theviajerock
Feb 17 2016 01:25
Mmmm but that is something with the API
Maddah Anass
@unlimiworks
Feb 17 2016 01:25
Yep, I hink it might be
Victor Hernandez
@Theviajerock
Feb 17 2016 01:26
Yeah, is not problem with getJSON
Maddah Anass
@unlimiworks
Feb 17 2016 01:28
@mutantspore Sorry, I didn't save my pen before you forked it
I guess i'll try my luck using anoher API
kiel barry
@kielbarry
Feb 17 2016 01:41
could someone look at my jQuery in priate convo? don't want to spam the whole chat
wyattelliott
@wyattwade
Feb 17 2016 01:44
@Fuzyon fixed that bug you found
@Fuzyon thanks again for finding it man
CamperBot
@camperbot
Feb 17 2016 01:44
wyattwade sends brownie points to @fuzyon :sparkles: :thumbsup: :sparkles:
:star: 179 | @fuzyon | http://www.freecodecamp.com/fuzyon
wyattelliott
@wyattwade
Feb 17 2016 01:44
@Fuzyon I'll post the new version in a sec
LoLRabbit
@KevinStaufy
Feb 17 2016 01:47
So ive gotten to the portfolio and i haven't learned any of this stuff yet?
Lanitta
@DivaWeb
Feb 17 2016 01:48
Yeah I know I found the same thing
@KevinStaufy but if you go to the bootstrap website will find all the info you need'
LoLRabbit
@KevinStaufy
Feb 17 2016 01:48
what do you mean?
Lanitta
@DivaWeb
Feb 17 2016 01:49
LoLRabbit
@KevinStaufy
Feb 17 2016 01:50
do i just go to the getting started or what?
Lanitta
@DivaWeb
Feb 17 2016 01:50
@KevinStaufy Do you understand what your assignment is?
@KevinStaufy I am working on the same project at the moment
kelly
@kwhms
Feb 17 2016 01:55
Hi All -- I'd like some help with my Random Quote Machine pen http://codepen.io/kwhms/pen/GoPMaz. I can't figure out how to insert my custom twitter URL created in javascript into the href attribute of my a tag.
LoLRabbit
@KevinStaufy
Feb 17 2016 01:55
@DivaWeb no clue
@DivaWeb i made a tribute but its not very good http://codepen.io/KevinStaufy/pen/GoexQP
Lanitta
@DivaWeb
Feb 17 2016 01:56
@KevinStaufy did you see the web site example?
LoLRabbit
@KevinStaufy
Feb 17 2016 01:56
@DivaWeb yea but that is like super advanced like i dont think i learned any of it
Lanitta
@DivaWeb
Feb 17 2016 01:56
@KevinStaufy I realize that the bootstrap section that they have is very limited
LoLRabbit
@KevinStaufy
Feb 17 2016 01:57
@DivaWeb saddly yea :(
Lanitta
@DivaWeb
Feb 17 2016 01:57
@KevinStaufy So let me see if I can help you get started
LoLRabbit
@KevinStaufy
Feb 17 2016 01:57
@DivaWeb alright cool :)
Lanitta
@DivaWeb
Feb 17 2016 01:58
@KevinStaufy the type of website that it is called is a bootstrap scrollspy.
Kevin Mulligan
@kmulligan
Feb 17 2016 01:58
@kwhms I can't help you with that - would love to know what you figure out - but love your design
LoLRabbit
@KevinStaufy
Feb 17 2016 01:59
@DivaWeb hmm interesting
Lanitta
@DivaWeb
Feb 17 2016 01:59
@KevinStaufy do you have your code pen account set up?
kelly
@kwhms
Feb 17 2016 01:59
@kmulligan thanks!
CamperBot
@camperbot
Feb 17 2016 01:59
kwhms sends brownie points to @kmulligan :sparkles: :thumbsup: :sparkles:
:star: 281 | @kmulligan | http://www.freecodecamp.com/kmulligan
LoLRabbit
@KevinStaufy
Feb 17 2016 01:59
@DivaWeb yes
i sent you a private chat
Lanitta
@DivaWeb
Feb 17 2016 02:00
@KevinStaufy ok
wyattelliott
@wyattwade
Feb 17 2016 02:00
Hey guys
Would anyone mind playing Tic Tac Toe to see if you can win
if you can there's a bug in my app
here it is:
Also, any other criticism is much appreciated
@mutantspore once I get rid of the bugs I will do something with the alerts
@mutantspore let me know if there's anything that doesn't look good.
Lanitta
@DivaWeb
Feb 17 2016 02:01
@KevinStaufy I am not see it
wyattelliott
@wyattwade
Feb 17 2016 02:01
@mutantspore or if the code looks ugly in spots
Dan Stockham
@DanStockham
Feb 17 2016 02:02
Is there any reason why my winning conditions are not working? https://www.repl.it/Bn0v
LoLRabbit
@KevinStaufy
Feb 17 2016 02:02
@DivaWeb its fine
Lanitta
@DivaWeb
Feb 17 2016 02:03
@KevinStaufy do you have the bootstrap page up?
LoLRabbit
@KevinStaufy
Feb 17 2016 02:04
@DivaWeb im on the homepage of http://getbootstrap.com/
kelly
@kwhms
Feb 17 2016 02:04
@kmulligan I think I got it -- $("#customTweet").attr("href", myQuoteURL);
Lanitta
@DivaWeb
Feb 17 2016 02:04
@KevinStaufy click on getting started
@KevinStaufy did you learn about libraries?
LoLRabbit
@KevinStaufy
Feb 17 2016 02:04
alright i did
no i havent
Lanitta
@DivaWeb
Feb 17 2016 02:05
@DivaWeb libraries are basically the dictionary for the language you want to use
LoLRabbit
@KevinStaufy
Feb 17 2016 02:05
ahh i see
Lanitta
@DivaWeb
Feb 17 2016 02:06
@KevinStaufy so you see the cdn to copy and paste?
LoLRabbit
@KevinStaufy
Feb 17 2016 02:06

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

that one?
Lanitta
@DivaWeb
Feb 17 2016 02:06
@KevinStaufy yes
@DivaWeb that is the library for bootstrap and it needs to be put into your head section of the code.
Dan Stockham
@DanStockham
Feb 17 2016 02:08
I guess what I really want to ask is it possible to test for win conditions using a one dimensional array on a two dimensional grid?
LoLRabbit
@KevinStaufy
Feb 17 2016 02:08
so it Always needs to go there?
Lanitta
@DivaWeb
Feb 17 2016 02:09
@KevinStaufy there are several libraries out there and you can find the others you may need at google libraries and yes to your question
LoLRabbit
@KevinStaufy
Feb 17 2016 02:09
ahhh i see
Kevin Mulligan
@kmulligan
Feb 17 2016 02:11
anyone know if codepen has dropdown.js
Lanitta
@DivaWeb
Feb 17 2016 02:12
@KevinStaufy if you want some more detailed info on using bootstrap here is a detailed video https://youtu.be/3cYWiU_HsgM
LoLRabbit
@KevinStaufy
Feb 17 2016 02:12
alright cool ill check it out

@DivaWeb do i past all of this <!-- Latest compiled and minified CSS -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

at the top?
Lanitta
@DivaWeb
Feb 17 2016 02:13
@KevinStaufy yes
LoLRabbit
@KevinStaufy
Feb 17 2016 02:13
alrighty ill get to work on it then thank you
Lanitta
@DivaWeb
Feb 17 2016 02:14
@KevinStaufy in the <head> section of your code
@KevinStaufy I hope that gets you off on the right foot.
Hey guys
Almost done with this project
any criticism is much appreciated
and if you can beat it
that's a huge bug
also if my code just looks ugly
let me know!
LoLRabbit
@KevinStaufy
Feb 17 2016 02:18
@DivaWeb wait
Lanitta
@DivaWeb
Feb 17 2016 02:18
@KevinStaufy yes
@wyattwade I didn't win I got a tie
LoLRabbit
@KevinStaufy
Feb 17 2016 02:18
do i put the big set of bootstrap above or in <head>
Lanitta
@DivaWeb
Feb 17 2016 02:19
@KevinStaufy You will put it inside the <head> tag
LoLRabbit
@KevinStaufy
Feb 17 2016 02:19
so
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>


<h1 class="text-center"> Kevin Stauferland's Portfolio </h1>
thats wrong right
Lanitta
@DivaWeb
Feb 17 2016 02:20
@KevinStaufy do you know what a deault html5 should look like?
wyattelliott
@wyattwade
Feb 17 2016 02:20
@DivaWeb Yeah I'm trying to make it unbeatable. Someone earlier found a huge bug tho
just fixed it like 15 mins ago
@DivaWeb any suggestions on the UX?
I might make it so you can pick what color you play as
Lanitta
@DivaWeb
Feb 17 2016 02:21
@wyattwade that would be cool because the blue is so light I didn't realize at first I was blue
LoLRabbit
@KevinStaufy
Feb 17 2016 02:21
@DivaWeb to an extent yea
wyattelliott
@wyattwade
Feb 17 2016 02:22
yeah thanks for checking it out @DivaWeb
CamperBot
@camperbot
Feb 17 2016 02:22
wyattwade sends brownie points to @divaweb :sparkles: :thumbsup: :sparkles:
:star: 216 | @divaweb | http://www.freecodecamp.com/divaweb
wyattelliott
@wyattwade
Feb 17 2016 02:22
if you have any other suggestions let me know
I'll be using this for a job application tomorrow
just an apprenticeship level job
Lanitta
@DivaWeb
Feb 17 2016 02:23
@KevinStaufy well your code should have a <head> tag and a <body> tag
@wyattwade I think most of us are
@KevinStaufy create a <head> </head> should before your body tag and put the libraries inside that
LoLRabbit
@KevinStaufy
Feb 17 2016 02:24
it didnt teach me <head> it taught me <h1>
Lanitta
@DivaWeb
Feb 17 2016 02:26
@KevinStaufy give me a sec and I will so you what the basic html5 format should be.
LoLRabbit
@KevinStaufy
Feb 17 2016 02:26
at that point i might just go run through code academys html and css course
so i know more about it
Andrew Charlebois
@andrewchar
Feb 17 2016 02:32
hey guys. working on my weather app. right now im trying to make a function that will show the weather icon on my page and trying to make it so it takes my api data and adds that icon number to the url to show you an icon. i have this so far but its just showing a broken image.
function weatherIcon() {
    var icon =  $(updateWeather.weather[0].icon);

    $("#icon").append("<img src='http://openweathermap.org/img/w/" + icon + ".png'>");
  }
Bruce Young
@mutantspore
Feb 17 2016 02:43
@andrewchar show us your pen and also you won’t need that $() around teh json object
@mutantspore oh.. i took out the $() and it works now lol
@mutantspore thanks a million!
CamperBot
@camperbot
Feb 17 2016 02:44
andrewchar sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1138 | @mutantspore | http://www.freecodecamp.com/mutantspore
Lanitta
@DivaWeb
Feb 17 2016 02:45

@KevinStaufy <!Doctype html>

<html>

<head>

//add libraries here//

<title>name of page<title>

</head>

<body>

//add what you want on your web page here.




</body>

</html>

LoLRabbit
@KevinStaufy
Feb 17 2016 02:45
@DivaWeb is <title> the same as <h1>?
Sloth
@RMo-Sloth
Feb 17 2016 02:46
Anyone willing to help me out with my navigation bar using bootstrap (I want to put a part on the right side and a part on the left) http://codepen.io/RobMo/pen/qbvoNj
Lanitta
@DivaWeb
Feb 17 2016 02:52
@KevinStaufy no <title> is the name of the page. so when you look at the tab in your browser you see the name of the page and that is what that does.
LoLRabbit
@KevinStaufy
Feb 17 2016 02:52
OOOOOOOOOOOOOOOOOOO
@DivaWeb i see now tahnks
thanks
Lanitta
@DivaWeb
Feb 17 2016 02:54
@KevinStaufy <h1> is the size of a header before your paragraph or list etc..... You have <h1>, <h2>,<h3>,<h4>,<h5>,<h6> and the bigger the size the smaller it gets
LoLRabbit
@KevinStaufy
Feb 17 2016 02:54
@DivaWeb ahhh sorry i got confused there haha thanks
CamperBot
@camperbot
Feb 17 2016 02:54
kevinstaufy sends brownie points to @divaweb :sparkles: :thumbsup: :sparkles:
:star: 217 | @divaweb | http://www.freecodecamp.com/divaweb
Lanitta
@DivaWeb
Feb 17 2016 02:55
@KevinStaufy hey no problem
Jason
@carpediem1213
Feb 17 2016 02:55
I've finished the basic JS algorithms. Now I am up to the Random Quote Generator. I've looked at the sample project, but I'm not sure I have the skill set to accomplish this one yet. Which lessons/challenges should I review to be prepared for these intermediate front end projects?
Lanitta
@DivaWeb
Feb 17 2016 02:56
@carpediem1213 I have found going to Youtube and watching videos sometimes explains things in a way that makes things look simple
Andrew Charlebois
@andrewchar
Feb 17 2016 02:57
does anyone know where i could find info about making a slide button, or does bootstrap offer something to make one?
Lanitta
@DivaWeb
Feb 17 2016 02:59

@RobMo check out this section on bootstrap Component alignment
Align nav links, forms, buttons, or text, using the .navbar-left or .navbar-right utility classes. Both classes will add a CSS float in the specified direction. For example, to align nav links, put them in a separate <ul> with the respective utility class applied.

These classes are mixin-ed versions of .pull-left and .pull-right, but they're scoped to media queries for easier handling of navbar components across device sizes.

Right aligning multiple components
Navbars currently have a limitation with multiple .navbar-right classes. To properly space content, we use negative margin on the last .navbar-right element. When there are multiple elements using that class, these margins don't work as intended.

We'll revisit this when we can rewrite that component in v4.

Sloth
@RMo-Sloth
Feb 17 2016 03:02
@DivaWeb I have already tried that for two hours now, I seem unable to find a solution myself. I tried the official documentation and the w3c.
Jason
@carpediem1213
Feb 17 2016 03:02
@DivaWeb Which topics would you recommend to be prepared for the intermediate challenges?
Lanitta
@DivaWeb
Feb 17 2016 03:07
@carpediem1213 I would start by looking at the functions and etc that are listed in the projects
zackluckyf
@zackluckyf
Feb 17 2016 03:08

Working on Random Quote Machine, stuck trying to get the giant quotes into the javascript like the example. I was able to do it easily when it wasn't with the text. I just want the ion-quote to be in there but I'm not sure how to do it.

<h2 id="quote"><i class="ion-quote quotes-icon"></i>Every collection of quotes has to start somewhere!</h2></div>
$("#quote").text(quotes[rand2]);

That's the html and the javascript, I tried using + inside the text function but no dice

Lanitta
@DivaWeb
Feb 17 2016 03:09
@RobMo I understand what you saying now and I am actually working on the same project. Did you try adding the left to the specific item or did you try giving it an id and float it in css?
DJ
@qualitymanifest
Feb 17 2016 03:09
@zackluckyf if you have a codepen, paste that
zackluckyf
@zackluckyf
Feb 17 2016 03:11
@qualitymanifest I don't I'm working in brackets
DJ
@qualitymanifest
Feb 17 2016 03:12
@zackluckyf well, without seeing/testing the big picture my guess is either you haven't loaded jquery in, or there's quotes[rand2] isn't accessing what you want it to
Sloth
@RMo-Sloth
Feb 17 2016 03:13
@DivaWeb Hmm I might be able to do a manual fix with css. But that won't teach me how to do it with bootstrap.
Adam Yuhasz
@jayuhasz
Feb 17 2016 03:19
Does this work for everyone? http://codepen.io/jayuhasz/full/KVERxy/
Lanitta
@DivaWeb
Feb 17 2016 03:32
@jayuhasz if location and conditions wind and temp are buttons they are not working
Adam Yuhasz
@jayuhasz
Feb 17 2016 03:33
@DivaWeb they are not buttons, just display panels
Andrew Charlebois
@andrewchar
Feb 17 2016 03:33
@jayuhasz can i ask why you use switch statements
@jayuhasz i am using just the icon ID that i get from the api info to give me their little icon for weather, the way you do it make different icons come up or something?
@jayuhasz just to show you what i mean
http://codepen.io/andrewchar/pen/dGrVJO?editors=1011
Adam Yuhasz
@jayuhasz
Feb 17 2016 03:35
@andrewchar I didn't like their icons, so I'm using other icons and need the switch statement, it also leaves room for more granularity if I got bored later.
Andrew Charlebois
@andrewchar
Feb 17 2016 03:36
@jayuhasz where do you get your icons from?
Adam Yuhasz
@jayuhasz
Feb 17 2016 03:37
@andrewchar it's in the pen's css settings, I believe
Andrew Charlebois
@andrewchar
Feb 17 2016 03:39
@jayuhasz awesome thank you!
CamperBot
@camperbot
Feb 17 2016 03:39
andrewchar sends brownie points to @jayuhasz :sparkles: :thumbsup: :sparkles:
:star: 296 | @jayuhasz | http://www.freecodecamp.com/jayuhasz
Maddah Anass
@unlimiworks
Feb 17 2016 03:42
Hi guys. I have a question concerning a test pen i've been meddling with:
1st : Why is my second console.log() executed before my first ?
2nd : Why does my 'quotes' variable lose its value outside of $.getJSON ?
http://codepen.io/UnlimiWorks/pen/WrWrLj?editors=0010
I'm really confused about this, i'll be grateful for any help i can get
h4r1m4u
@h4r1m4u
Feb 17 2016 03:43

Finally fixed it up a bit. At least that one chunk of code. Couldn't have done it without you thanks again man @h4r1m4u . Have a good night

@wyattwade excellent, glad to hear that; nice work! you're most welcome

CamperBot
@camperbot
Feb 17 2016 03:43
sorry h4r1m4u, you can't send brownie points to yourself! :sparkles: :sparkles:
:star: 254 | @wyattwade | http://www.freecodecamp.com/wyattwade
Andrew Charlebois
@andrewchar
Feb 17 2016 03:51
my geolocation is telling me that im like 200 km away from where i actually am lol
Bruce Young
@mutantspore
Feb 17 2016 03:55
@andrewchar geolocation? or ip based system?
Andrew Charlebois
@andrewchar
Feb 17 2016 03:56
the location that my weather app is telling me
Bruce Young
@mutantspore
Feb 17 2016 03:57
@andrewchar yes… but how are you working out the lat and lon.. I can’t remember how you were doing it
pen?
Bruce Young
@mutantspore
Feb 17 2016 04:00
@andrewchar ok for me it’s accurate. How are you connected to the internet?
Andrew Charlebois
@andrewchar
Feb 17 2016 04:00
i know some code is out of whack im putting random stuff in to figure out how to convert my link to show C and F
satalite internet
Adam Yuhasz
@jayuhasz
Feb 17 2016 04:00
@andrewchar that'll do it.
Bruce Young
@mutantspore
Feb 17 2016 04:01
ok well maybe that’s were it thinks you… are
Andrew Charlebois
@andrewchar
Feb 17 2016 04:01
yeah, 200km is actually shorting it. for me to drive to where its telling me i am, it would take me 5-6 hours lol
Bruce Young
@mutantspore
Feb 17 2016 04:02
i’s it 2 way satellite or sat down and phone up? (or am i showing my age?)
Andrew Charlebois
@andrewchar
Feb 17 2016 04:02
2 way satellite
Bruce Young
@mutantspore
Feb 17 2016 04:03
lol maybe it thinks you are in space :) i don’t know the specifics of what it’s identifying and why but I’m sure that’s the reason
Andrew Charlebois
@andrewchar
Feb 17 2016 04:03
lol
i first noticed when it said it was raining here
i was like hmmm we got a foot of snow today thats not right
Adam Yuhasz
@jayuhasz
Feb 17 2016 04:05
@andrewchar it's giving you the geolocation of your ISP's facility that's connected to their trunk line
it also explains what methods it uses to find you
Andrew Charlebois
@andrewchar
Feb 17 2016 04:07
@mutantspore yep still showing coatcook
oh well
Bruce Young
@mutantspore
Feb 17 2016 04:09
@andrewchar it will be fine for most people
Gabriel
@Zera99
Feb 17 2016 04:09
Why are my wells.. so close to each other? http://codepen.io/Zera99/pen/JGxQXy?editors=1100
Andrew Charlebois
@andrewchar
Feb 17 2016 04:09
yeah. i'm just the unlucky one who is stuck with satellite internet lol
dposse
@dposse
Feb 17 2016 04:18
what do you mean wells?
Gabriel
@Zera99
Feb 17 2016 04:19
Bootstrap wells ^^
Ankit Panwar
@coderNoob
Feb 17 2016 04:39
@h4r1m4u But can't we set format=jsonp instead of adding the callback parameter?
h4r1m4u
@h4r1m4u
Feb 17 2016 04:59
@coderNoob you could - if the server is configured to know what to do with it. i might be wrong but i think wikipedia doesn't support format=jsonp parameter. the point i was making is that "So what the call back function does is, it prevents the statement from executing until all the data is fetched from the API call." is not quite a correct explanation of the callback parameter
Jovvi Johnson
@jovjohnson
Feb 17 2016 05:14
would anyone be able to take a look at my javascript code for a widget i'm building? i can't get the events to cooperate
steve
@davidsonsteve
Feb 17 2016 05:19
@batilc1 thanks again for your help earlier if you're still on, the hint to use ajax for the wiki search page was a lifesaver
CamperBot
@camperbot
Feb 17 2016 05:19
davidsonsteve sends brownie points to @batilc1 :sparkles: :thumbsup: :sparkles:
:star: 209 | @batilc1 | http://www.freecodecamp.com/batilc1
h4r1m4u
@h4r1m4u
Feb 17 2016 05:20
@jovjohnson it's usually better to post the question right away. then people in the room can check out what the problem is and see if they're able to help. on that note, what's the issue?
Ogundele Olumide
@Lumexralph
Feb 17 2016 05:43

hello guys, am working on the pomodoro and this is how am thinking of tackling the project

1.have two global variable, break time and session time in secs

  1. create functions that increases and decreases length of session and break and updates the new time when clicked

  2. functions that starts session time and break time count by getting the time updated by the functions above and start a countdown on it

  3. use a function to toggle between the 2 modes using a boolean to indicate when session is running and if done start break session

5.a function to pause the event using clearInterval.

That's what I can think of , thanks for your time

h4r1m4u
@h4r1m4u
Feb 17 2016 05:45
@Lumexralph sounds pretty good to me. here's a tip: you don't need two variables for the break and session time. have only one - let's call it mainTime. then whenever the timer reaches zero and you need to change the clock mode, get the value of the break or session from the DOM and assign it to your mainTime. that way you only need one function to start the countdown interval (or clear it). other than that, i think you're on the right track
Bruce Young
@mutantspore
Feb 17 2016 05:48
@Lumexralph you only need one countdown function.. just feed it different variables
Ogundele Olumide
@Lumexralph
Feb 17 2016 05:50
thanks @mutantspore @h4r1m4u .....will work on it
CamperBot
@camperbot
Feb 17 2016 05:50
lumexralph sends brownie points to @mutantspore and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1420 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 1142 | @mutantspore | http://www.freecodecamp.com/mutantspore
Joseph Morse
@jnmorse
Feb 17 2016 05:51
@Lumexralph I had pause as another var that the interval function checks, if its paused it skips decrementing the current time, until it is unpaused. stop with clearIntrerval, also I wouldn't get any values from the dom, only interaction should be outputting to the dom.
Ogundele Olumide
@Lumexralph
Feb 17 2016 05:54
@jnmorse ..you mean the click events?
Joseph Morse
@jnmorse
Feb 17 2016 05:56
@Lumexralph in the first part of what I said, I meant when you click on paused I set a var paused to true, if you clear the interval and then start again its likely going to end up starting from the beginning, less you somehow save the state which I suppose could work.
h4r1m4u
@h4r1m4u
Feb 17 2016 06:00
@jnmorse if you use only one variable to track the time and update it only when the timer reaches 0 (to start a new full work or break session), then your current time on the clock will be preserved when you clear the interval for pausing. clearing the interval seems cleaner rather than having the interval constantly running in the background even if the clock is paused
Joseph Morse
@jnmorse
Feb 17 2016 06:02
@h4r1m4u the way I had it set up, the variable ended up back to its default state if I did clearinterval shrugs
Jovvi Johnson
@jovjohnson
Feb 17 2016 06:03
@h4r1m4u http://codepen.io/jov/pen/mVoGXy
the spinners in my number fields aren't executing my jquery event
h4r1m4u
@h4r1m4u
Feb 17 2016 06:04
@jovjohnson and what's the result that you want? what exactly should be happening?
Jovvi Johnson
@jovjohnson
Feb 17 2016 06:04
and they're doing wonky things when the assorted veggies div field is clicked
the green text that displays the total price should be corresponding with the quantity and price per item
h4r1m4u
@h4r1m4u
Feb 17 2016 06:05
ok, gotcha. let me have a look at it
Bruce Young
@mutantspore
Feb 17 2016 06:06
@jovjohnson what is this? .. another new challenge?
Alvis Ng
@vizFlux
Feb 17 2016 06:07
Hi guys, I’ve been coding the Pomodoro timer before this project recently categorized to an advanced front-end project. So it is being coded without any framework but plain JS, and now I am stucked at the timeCount() just won’t reach to 0 before ended and switched into breakInterval. Would really appreciate any help from anyone who’ve cleared this task. :smile:
var break_length;
var session_length;
var minutes;
var interval;
var breakInterval;
var seconds = 0;
​
function increaseBreak(break_length) {
    break_length++;
    $('#break').html(break_length);
    return break_length;
}
​
function decreaseBreak(break_length) {
    break_length--;
    if (break_length < 1) {
        break_length = 1;
    }
    $('#break').html(break_length);
    return break_length;
}
​
function increaseSession(session_length) {
    session_length++;
    $('#session').html(session_length);
    $('#total').html(session_length);
    return session_length;
}
​
function decreaseSession(session_length) {
    session_length--;
    if (session_length < 1) {
        session_length = 1;
    }
    $('#session').html(session_length);
    $('#total').html(session_length);
    return session_length;
}
​
function countdownCtrl() {
    if (seconds === 0) {
        minutes--;
        seconds = 59;
    } else {
        seconds--;
    }
    // Executing timeCount();
    (function timeCount() {
        if (minutes === 0 && seconds === 0) {
            clearInterval(interval);
            if (break_length) {
                breakInterval = setInterval(breakcountCtrl, 1000);
            }
        } else {
            $('#total').html(minutes + ":" + (seconds < 10 ? "0" : "") + String(seconds));
        }
    })();
​
    function breakcountCtrl() {
        $('#total').html(break_length--);
    }
}
​
$(document).ready(function() {
    break_length = parseInt($('#break').text());
    session_length = parseInt($('#session').text());
    minutes = session_length;
​
    $('#ibl').click(function() {
        break_length = increaseBreak(break_length);
    });
​
    $('#dbl').click(function() {
        break_length = decreaseBreak(break_length);
    });
​
    $('#ise').click(function() {
        session_length = increaseSession(session_length);
        minutes = session_length;
    });
​
    $('#dse').click(function() {
        session_length = decreaseSession(session_length);
        minutes = session_length;
    });
​
    $('#total').click(function() {
        if (interval) {
            clearInterval(interval);
            interval = undefined;
        } else {
            interval = setInterval(countdownCtrl, 50);
        }
    });
​
});
Harry Aydin
@HMAN1911
Feb 17 2016 06:11
@jovjohnson You need to write a new function that deals with the counter value being changed, and make sure you're rendering the updated value on each click event. Hope that hint helps :smile:
edit: throw some console.log's in there to see if the value is actually being updated ;)
Ankit Panwar
@coderNoob
Feb 17 2016 06:13
Guys lemme know if you can beat this game. Would be a great help :smile:
Tic-Tac-Toe
Jovvi Johnson
@jovjohnson
Feb 17 2016 06:15
@hman1911 hmm. thanks. not sure where to start with a new function though. i'll play around with it some more.
CamperBot
@camperbot
Feb 17 2016 06:15
jovjohnson sends brownie points to @hman1911 :sparkles: :thumbsup: :sparkles:
:star: 85 | @hman1911 | http://www.freecodecamp.com/hman1911
Ankit Panwar
@coderNoob
Feb 17 2016 06:23
My reset button is not working. But works fine in DevTools mode. Why?
http://codepen.io/coderNoob/pen/vLmyWN
Harry Aydin
@HMAN1911
Feb 17 2016 06:24
@jovjohnson This so question should help http://stackoverflow.com/questions/16562389/get-spinner-ui-value-on-change
$(document).ready(function() {

  function spinnerChange(event) {
    //this function gets called when the spinner value chages.
    //your code here :)
  }

  $('input[name=quantity]').on("click",function() {
               var button = $(this).closest(".quant");
               var price = button.data("price");
               price = parseFloat(price);
               var num = $("input[type=number]").val();
            var total = (num * price).toFixed(2);
            var totalPrint = $('<p class="total">($' + total + ' TOTAL)</p>');
                if(num >= 2){

                $('.price').find('.total').html(totalPrint);

                }

        });
h4r1m4u
@h4r1m4u
Feb 17 2016 06:26
@jovjohnson here you go:
$(document).ready(function() {

  $('input[name=quantity]').on("click",function() {
               var price = $(this).data("price");
               price = parseFloat(price);
               var num = $(this).val();
                var total = (num * price).toFixed(2);
                if(num >= 2){
                  $(this).closest('.row').find('.total').text("($" + total + " TOTAL)");                            
                }            
        });

});
Ankit Panwar
@coderNoob
Feb 17 2016 06:29
Help with the reset button anyone?
http://codepen.io/coderNoob/pen/vLmyWN?editors=1010
CamperBot
@camperbot
Feb 17 2016 06:29
no wiki entry for: with the reset button anyone httpcodepeniocodernoobpenvlmywneditors1010
adhok
@adhok
Feb 17 2016 06:34
Hi, I had a doubt regarding centering of the buttons for my front end project(Portfolio Page). I have used the container class made available by bootstrap css. Yet the buttons appear to be left-aligned. Here is the code.http://codepen.io/adhok/pen/PZVVPJ
Jovvi Johnson
@jovjohnson
Feb 17 2016 06:35
@HMAN1911 thanks for the link
CamperBot
@camperbot
Feb 17 2016 06:35
jovjohnson sends brownie points to @hman1911 :sparkles: :thumbsup: :sparkles:
:warning: jovjohnson already gave hman1911 points
Jovvi Johnson
@jovjohnson
Feb 17 2016 06:36
@h4r1m4u works like a gem. would you mind briefly explaining my error?
h4r1m4u
@h4r1m4u
Feb 17 2016 06:36
@adhok add text-center class on the row div that holds the buttons
    <div class="row text-center">
      <a href="www.twitter.com" target="_blank" class="btn btn-default btn-lg "><i class="fa fa-twitter fa-fw"></i>Twitter</a>
      <a href="www.twitter.com" target="_blank" class="btn btn-default btn-lg "><i class="fa fa-linkedin fa-fw"></i>LinkedIn</a>
      <a href="www.twitter.com" target="_blank" class="btn btn-default btn-lg"><i class="fa fa-github fa-fw"></i>GitHub</a>
      <a href="www.freecodecamp.com" target="_blank" class="btn btn-default btn-lg"><i class="fa fa-fire fa-fw"></i>FreeCodeCamp</a>      
    </div>
@jovjohnson i don't have your original code anymore :D do you still have it somewhere?
adhok
@adhok
Feb 17 2016 06:40
@h4r1m4u Thank You!
CamperBot
@camperbot
Feb 17 2016 06:40
adhok sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1421 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Casey Heath
@ExhibitArts
Feb 17 2016 06:48
This message was deleted
Jovvi Johnson
@jovjohnson
Feb 17 2016 06:49
$(document).ready(function() {

           $('input[name^=quantity]').on("click",function() {
               var button = $(this).closest(".quant");
               var price = button.data("price");
               price = parseFloat(price);
               var num = $("input[type=number]").val();
            var total = (num * price).toFixed(2);
            var totalPrint = $('<p id="total">($' + total + ' TOTAL)</p>');
                if(num >= 2){

                $('.price').find('.total').html(totalPrint);

                }

        });
something like that anyway @h4r1m4u
haha
h4r1m4u
@h4r1m4u
Feb 17 2016 06:56
$(document).ready(function() {

           $('input[name^=quantity]').on("click",function() {
               var button = $(this).closest(".quant"); //  not needed; you're already clicking on the input which contains the price in the data-price attribute, hence you can simply use "this"
               var price = button.data("price");
               price = parseFloat(price);
               var num = $("input[type=number]").val(); // similar to the above. it's the same input element, "this" suffices
            var total = (num * price).toFixed(2);
           // here you're using the jQuery selector $(), but the selector doesn't make much sense. selector should generally be a the element, class, id or combination of thereof
          // i'm assuming that what you meant to do here is to construct the string for the total price. if that's the case, you'd do it without the $() selector
            var totalPrint = $('<p id="total">($' + total + ' TOTAL)</p>'); 
                if(num >= 2){

                // the problem with the $('.price') selector is that it's the same in all the 3 boxes (each box has a .price paragraph). so even if you're changing
              // the qty in the 3rd box, it'll rewrite the total price in the first box. we need to somehow tie it to changing the price only in the box where we're
             // changing the qty - which is where "this" comes into play again
                $('.price').find('.total').html(totalPrint);

                }

        });
kaizen711
@kaizen711
Feb 17 2016 07:08
Hey Guys, Does anybody know why the drop down in my navbar using bootstrap isn't working? Any help is appreciated.
http://codepen.io/kaizen7/pen/WrWGgp
h4r1m4u
@h4r1m4u
Feb 17 2016 07:09
@kaizen711 you forgot to import the bootstrap.js file
add this in the JS resources of the codepen: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
@jovjohnson sorry, forgot to tag you. my comments as to why your code was not working are 3 messages above
kaizen711
@kaizen711
Feb 17 2016 07:11
@h4r1m4u wow I didn't even know that existed, thank you very much, I'd been trying to see what was wrong for a while
CamperBot
@camperbot
Feb 17 2016 07:11
kaizen711 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1422 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 17 2016 07:12
@kaizen711 np. yeah, basically all the functionality that's described on this page: http://getbootstrap.com/javascript/ requires the bootstrap.js library imported
kaizen711
@kaizen711
Feb 17 2016 07:13
@h4r1m4u awesome thanks again
CamperBot
@camperbot
Feb 17 2016 07:13
kaizen711 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: kaizen711 already gave h4r1m4u points
Mannu Gupta
@theparadoxer02
Feb 17 2016 07:34
Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
solution plz
stuck here
kirbyedy
@kirbyedy
Feb 17 2016 07:35
is there a table on the left with explanation codes ?
Alvis Ng
@vizFlux
Feb 17 2016 07:45
I am stucked at the timeCount() just won’t reach to 0 before clearInterval() and switched into breakInterval. Would really appreciate any help from anyone who’ve cleared this task. :smile:
http://codepen.io/vizFlux/pen/WrmmVQ
Goje Samuel Andrei Daniel
@pringon
Feb 17 2016 08:07
hey guys
can i please get some help with my tic tac toe game?
the filter only works on the first press
then it stop working for some reason
wyattelliott
@wyattwade
Feb 17 2016 08:17
hey guys
batilc1
@batilc1
Feb 17 2016 08:19
@davidsonsteve ima glad it worked, youre welcome!
wyattelliott
@wyattwade
Feb 17 2016 08:19
which filter @pringon ?
Goje Samuel Andrei Daniel
@pringon
Feb 17 2016 08:19
the remaining = remaining.filter
wyattelliott
@wyattwade
Feb 17 2016 08:26
what line?
i'll check it now
ahh i see it
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 08:54
Does somebody know why I am getting my string inversed in the calculator text-box? If I set this outside the text box, in a div for instance it shows it the correct way.
http://codepen.io/DiazPedroAbel/pen/pgRXWv?editors=1010
Someone (I cannot remember who and I cannot see previous mentions :S) told me that I have to treat op similar way as current, but I don't see how to do it, in fact, I thought I was treating both similar way by adding them to the string. eval() works perfect so...
h4r1m4u
@h4r1m4u
Feb 17 2016 09:41
@Abel1987 it's because of direction: rtl;on .calculator input[type='text'] in your CSS. 'rtl' stand for right to left. instead, use text-align: right;
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 09:48
@h4r1m4u thats it... I copy that calculator to just get into programming it, and I guess it has this kind of inconvenients. I was looking at the html and on the javascript trying to fixt it but forget about css. Thanks a lot @h4r1m4u .
h4r1m4u
@h4r1m4u
Feb 17 2016 09:48
no prob
Max
@Spacecortez
Feb 17 2016 09:59
Hi, does anyone know why the carousel my page won't animate/respond? http://codepen.io/spacecortez/pen/dGLpbq?editors=1100
h4r1m4u
@h4r1m4u
Feb 17 2016 10:01
@Spacecortez you forgot to import jquery and bootstrap.js into your project
Max
@Spacecortez
Feb 17 2016 10:02
I quick added bootstrap in the CSS section settings, shouldn't that work?
h4r1m4u
@h4r1m4u
Feb 17 2016 10:03
nope. that's just the CSS library that's part of bootstrap
Max
@Spacecortez
Feb 17 2016 10:03
ohh
it's fixed, thanks :D
h4r1m4u
@h4r1m4u
Feb 17 2016 10:03
:thumbsup:
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 10:57

Sorry guys, today I know I am tremendously annoying, but I cannot fix those litle things.

http://codepen.io/DiazPedroAbel/pen/pgRXWv

I want to put a background in my calculator webpage, so I change it from the body background but it makes something weird. Looks like its broken in 3 pieces or rows...

greg
@wearenotgroot
Feb 17 2016 11:02
@Abel1987 add no-reapeat fixed
h4r1m4u
@h4r1m4u
Feb 17 2016 11:04
also, you're setting the same background for both body and html. set it only for one of the elements
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 11:08
Thanks @wearenotgroot That's kind of weird because I tried this before, I mean, I put fixed no-repeat; and didn't work
CamperBot
@camperbot
Feb 17 2016 11:08
abel1987 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 880 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 11:10
Thanks a lot, by the way, I am trying to move the calcultor to the bottom but setting in the calculator class align="bottom" or right does not work. Any idea? @wearenotgroot
CamperBot
@camperbot
Feb 17 2016 11:10
abel1987 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: abel1987 already gave wearenotgroot points
Goje Samuel Andrei Daniel
@pringon
Feb 17 2016 11:12
@Abel1987 try something like margin-top: xpx; or margin-bottom: -xpx; the align only works for center left and right as far as i know
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 11:19
@pringon umm, is not what exactly I was looking for because If the screen is smaller the calculator gets out of it.
Goje Samuel Andrei Daniel
@pringon
Feb 17 2016 11:19
then you could try using percentages
instead of pixels
not sure how well it works for height
but for width it works perfectly
yep
it should work
tried it on mine
i used a margin-top of about 27 percent
you can play around with it until it works for you
Ruslan Mavletkulov
@rusaym
Feb 17 2016 11:22
Hey, guys! Can enyone help me to figure out with some incomprehensible part of inheritance in javasript?
I have a Vehicle base class
and child Car class
var Car = (function (parent) {
Car.prototype = new Vehicle();
Car.prototype.constructor = Car;
function Car(year, make, model) {
parent.call(this, year, make, model);
this.wheelQuantity = 4;
}Car.prototype.getInfo = function () {
return 'Vehicle Type: Car ' + parent.prototype.getInfo.call(this);
return Car;
})(Vehicle);
why we use that "Car.prototype.constructor = Car;"
If it works whithout that expression?
Pedro Abel Díaz Sánchez
@coderHook
Feb 17 2016 11:32
Thanks @pringon thats better :)
CamperBot
@camperbot
Feb 17 2016 11:32
abel1987 sends brownie points to @pringon :sparkles: :thumbsup: :sparkles:
:star: 242 | @pringon | http://www.freecodecamp.com/pringon
Goje Samuel Andrei Daniel
@pringon
Feb 17 2016 11:39
@Abel1987 no problem mate :D
Harry Aydin
@HMAN1911
Feb 17 2016 11:59

@rusaym When you call new Vehicle, the constructor of car will actually lead to Vehicle, which people think means 'was constructed by'. It actually doesn't mean that at all. Prototypal inheritance is a complicated concept, and is very different to class based inheritance. I recommend reading this free book for a great explanation:

https://github.com/getify/You-Dont-Know-JS/tree/master/this%20%26%20object%20prototypes

But regarding your question, you don't need to include that line at all for what you are doing.

Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:06
Hi
When working on the Weather project, codepen doesn't prompt me for geolocation permissions and am unable to display anything. Anyone faced the same problem?
Ruslan Mavletkulov
@rusaym
Feb 17 2016 12:07
@HMAN1911 thank you:thumbsup:
CamperBot
@camperbot
Feb 17 2016 12:07
rusaym sends brownie points to @hman1911 :sparkles: :thumbsup: :sparkles:
:star: 86 | @hman1911 | http://www.freecodecamp.com/hman1911
Harry Aydin
@HMAN1911
Feb 17 2016 12:08
@dshgna can you post your pen please
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:10
@HMAN1911: sure, I'm just starting off
http://codepen.io/dshgna/pen/ZQZBOq?editors=1011
Harry Aydin
@HMAN1911
Feb 17 2016 12:13
@dshgna getCurrentLocation is disabled on insecure origins. Basically, you need to be using HTTPS for it to work. I would recommend using the coordinates of the IP address for this project.
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:18
@HMAN1911 using the ipinfo API right?
Harry Aydin
@HMAN1911
Feb 17 2016 12:18
@dshgna That one would be fine, but there are others out there :)
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:18
hints? :D
kirbyedy
@kirbyedy
Feb 17 2016 12:23
@dshgna you have a typo there
@dshgna is the console returning the position for you ?
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:24
@kirbyedy where exactly?
kirbyedy
@kirbyedy
Feb 17 2016 12:26
are you getting the position in the console ?
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:26
@kirbyedy as I've mentioned earlier, it doesn't display anything
kirbyedy
@kirbyedy
Feb 17 2016 12:26
yes, because you have a typo
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:26
where's the typo?
kirbyedy
@kirbyedy
Feb 17 2016 12:27
lot = position.coords.longitude;
url = "api.openweathermap.org/data/2.5/weather?lat="; + lat + "&lon=" + lon + "APPID=" + key;
and here you use lon
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:29
thanks so much @kirbyedy for spotting.
CamperBot
@camperbot
Feb 17 2016 12:29
dshgna sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 483 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
kirbyedy
@kirbyedy
Feb 17 2016 12:29
is it returning the location now ?
greg
@wearenotgroot
Feb 17 2016 12:30
@dshgna another thing
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:31
its returning the lat and lon but not displaying the data
greg
@wearenotgroot
Feb 17 2016 12:31
@dshgna you have to add jquery on the js settings
@dshgna beacuse you are using $.getJSON<-------------from jquery
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:31
@wearenotgroot errgh yes!
thanks @wearenotgroot
CamperBot
@camperbot
Feb 17 2016 12:32
dshgna sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 881 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
Feb 17 2016 12:32
@dshgna also
@dshgna your url
@dshgna you need to append in front of it------>http://
@dshgna or else it will throw an error
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:33
@wearenotgroot yes...figured that out. Thanks very much again :D
CamperBot
@camperbot
Feb 17 2016 12:33
dshgna sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: dshgna already gave wearenotgroot points
greg
@wearenotgroot
Feb 17 2016 12:35
@dshgna YW
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:38
a quick question, is it generally better to use var when declaring a variable in all cases?
Suryavamsi Teneti
@Surya97
Feb 17 2016 12:39
@Surya97
Guys I need some info about how to create a thumbnail which on hover should give options for download, view and delete.
can anyone please tell how to do so?
greg
@wearenotgroot
Feb 17 2016 12:40
@dshgna if you dont use var then it will interpreted as a global variable
Suryavamsi Teneti
@Surya97
Feb 17 2016 12:40
guys can anyone please help me?
greg
@wearenotgroot
Feb 17 2016 12:41
@dshgna the problem lies if a function has a similar named variable. then if not handled properly a variable value might be overridden
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:41
@wearenotgroot yes, so its always best to declare as local variables? I was wondering in scenarios like relatively lesser logic like this.
greg
@wearenotgroot
Feb 17 2016 12:41
@dshgna yep
@dshgna also it depends on where those variables are located
@dshgna right now your variables are considered global
@dshgna accessible throughout the entire page
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:43
which may be a problem if future functions modify the value right?
greg
@wearenotgroot
Feb 17 2016 12:43
yes
@dshgna try and enclosed them in a function and call the function to execute down the page or with $(document).ready(function(){ "your code here" }); <------this way they are all within the scope of that function

@dshgna would look like this

$(document).ready(function(){

  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var lat = position.coords.latitude;
      var lon = position.coords.longitude;
      var key = "6fccda1c30c7f392d44016c2bb3b6519";
      var url = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=" + key;
      $.getJSON(url, function(data) {
        var temp_celsius = data.main.temp;
        var country = data.sys.country;
        var city = data.country;
        var weather = data.weather.main;
        console.log(temp_celsius);
        console.log(country);
        console.log(data);
        console.log(weather);
      });
    });
  }

});

or

function start(){

  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var lat = position.coords.latitude;
      var lon = position.coords.longitude;
      var key = "6fccda1c30c7f392d44016c2bb3b6519";
      var url = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=" + key;
      $.getJSON(url, function(data) {
        var temp_celsius = data.main.temp;
        var country = data.sys.country;
        var city = data.country;
        var weather = data.weather.main;
        console.log(temp_celsius);
        console.log(country);
        console.log(data);
        console.log(weather);
      });
    });
  }

}

start();
Dulshani Gunawardhana
@dshgna
Feb 17 2016 12:48
@wearenotgroot Thanks so much. I'll do so.
CamperBot
@camperbot
Feb 17 2016 12:48
dshgna sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: dshgna already gave wearenotgroot points
greg
@wearenotgroot
Feb 17 2016 13:03
@dshgna btw if you look at the api docs ------>http://openweathermap.org/current scroll down on the section for Units Format
@dshgna you can set the unit system to use for the returned result. either imperial or metric. else you will standard measurements
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:07
@wearenotgroot yes I already modified my pen for that using metric.
greg
@wearenotgroot
Feb 17 2016 13:08
@dshgna ok :+1:
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:08
@wearenotgroot did you use the OWM icons or another set of icons?
greg
@wearenotgroot
Feb 17 2016 13:08
@dshgna nope
@dshgna just use the icon from the site
@dshgna you can get the icon name
@dshgna from the data you received

@dshgna then jsut append the url -------->http://openweathermap.org/img/w/'+iconname+'.png'

use this as source in <img scr=>

Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:11
@wearenotgroot yes that's what I meant :)
OWM = open weather map
thanks a lot anyway @wearenotgroot :)
CamperBot
@camperbot
Feb 17 2016 13:11
dshgna sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: dshgna already gave wearenotgroot points
greg
@wearenotgroot
Feb 17 2016 13:11
@dshgna yes i get the context :smile:
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:11
hopefully I'll be able to finish this soon!
greg
@wearenotgroot
Feb 17 2016 13:11
@dshgna btw the icon name is inside the weaher property, just an fyi the weather contains an array
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:12
yes, got it :) that was a bit confusing , figuring out the array
greg
@wearenotgroot
Feb 17 2016 13:13
@dshgna yep it was because on some area they have weird weather :smile:
@dshgna so the main weather is at index 0
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:13
oh...like two different types of weather :O?
that's funny
greg
@wearenotgroot
Feb 17 2016 13:14
@dshgna other than that additional weather conditions are at index after
@dshgna it's mostly fog and mist mixed in the main weather condtions
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:15
@wearenotgroot ah I see. so at which project are you now at?
greg
@wearenotgroot
Feb 17 2016 13:15
@dshgna Iam at tic tac toe and simon game
@dshgna not in a rush though :smile:
@dshgna also i just do what i feel like doing :smile:
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:17
@wearenotgroot both of them look rather complicated at first glance
greg
@wearenotgroot
Feb 17 2016 13:18
@dshgna well it's just designing your own logic for the game that is the tricky part
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:19
@wearenotgroot what about ui?
greg
@wearenotgroot
Feb 17 2016 13:19
@dshgna well if you already made it this far, that part is not that difficult
@dshgna and it's your choice to make it fancy or not :smile:
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:20
@wearenotgroot haha I really lack the patience for ui :(
greg
@wearenotgroot
Feb 17 2016 13:21
@dshgna well ui is an art on its own
Dulshani Gunawardhana
@dshgna
Feb 17 2016 13:23
@wearenotgroot indeed :)
Jack Lyons
@JackEdwardLyons
Feb 17 2016 13:30
hey guys, im soooooo close to finishing my clock, but I just have a problem when the clock hits 0... it counts back to 59:59
any ideas?
greg
@wearenotgroot
Feb 17 2016 13:38
@JackEdwardLyons yep
@JackEdwardLyons the -1
@JackEdwardLyons `
function countDownFrom(seconds) {

  if (playing) {
    if (seconds > -1) {  //<-----------------culprit should be 0
      setTimeout(function() {
        counterValue = countDownFrom(seconds = seconds - 1)
        renderTime(seconds);
      }, 1000);
    } else {
      playing = false;
      seconds = 0;
    }
  }

  return seconds;

}
Tony Miri
@TonyMiri
Feb 17 2016 14:20
Hey everybody. Does anyone have any recommendations for some Android apps that would allow a person to code html/css/javascript in a easy way. Something like CodePen for mobile? Or at least something where you can preview your work?
kirbyedy
@kirbyedy
Feb 17 2016 14:21
good question, never heard of anything like that :)
personally for me, coding on the smartphone would be a nightmare
Andrew Vanboxel
@avanbox
Feb 17 2016 14:32
you guys ever experience where your brain refuses to cooperate when your trying to solve a problem?
kirbyedy
@kirbyedy
Feb 17 2016 14:34
mhm... every third day
take a break
Andrew Vanboxel
@avanbox
Feb 17 2016 14:35
Im going to when this project is done. Super close on my calculator, just a bug I am having a brain block about lol
Tony Miri
@TonyMiri
Feb 17 2016 14:40
I have to spend a lot of time away from my pc during regular work hours, but while I'm working I have downtime. Sometimes I'll sit and do nothing for up to 3 hours. Thought it would be a good use of time to get some coding in. I guess I'll be the Guinea pig and let you guys know what I find.
Andrew Vanboxel
@avanbox
Feb 17 2016 14:41
if codepen works in a mobile browser, youd just need a bluetooth keyboard or something
h4r1m4u
@h4r1m4u
Feb 17 2016 14:43
@FatTone225 @avanbox yeah, the codepen editor is optimized for mobile. why not use that?
Tony Miri
@TonyMiri
Feb 17 2016 14:45
@h4r1m4u I probably will. Hoping it has some kind of keyboard shortcuts for mobile
@h4r1m4u Thanks for the link!
CamperBot
@camperbot
Feb 17 2016 14:46
fattone225 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1424 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 17 2016 14:46
you betcha. yeah, i don't know if it has any shortcuts. like @kirbyedy, thinking about coding on my mobile device gives me nightmares ;)
Tony Miri
@TonyMiri
Feb 17 2016 14:48
I have to admit though, CodePen is pretty darn awesome
Andrew Vanboxel
@avanbox
Feb 17 2016 14:49
i hate it actually haha
if i could get webstorm or something working right i would avoide codepen
Dulshani Gunawardhana
@dshgna
Feb 17 2016 14:50
hate codepen :O?
Now that I've got used to codepen, I'd hate to use an ide for web dev
critiques for my weather app please...
http://codepen.io/dshgna/full/ZQZBOq/
Pavel
@Savrov
Feb 17 2016 14:53
Guys, challenge "Build a Random Quote Machine". Where i should take quotes? Some API?
h4r1m4u
@h4r1m4u
Feb 17 2016 14:55
@Savrov yeah, either an API or you can store them locally in your code in an array
Andrew Vanboxel
@avanbox
Feb 17 2016 14:56
I stored mine in an array but in the future id like to change it to an api of some sort
Dulshani Gunawardhana
@dshgna
Feb 17 2016 14:56
@Savrov I used a Mashape API
Andrew Vanboxel
@avanbox
Feb 17 2016 14:56
@dshgna works great for me.
Pavel
@Savrov
Feb 17 2016 14:57
@h4r1m4u thanks, one dude gave me that: http://quotesondesign.com/ (API link at bottom)
CamperBot
@camperbot
Feb 17 2016 14:57
savrov sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1425 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Pavel
@Savrov
Feb 17 2016 14:57
@dshgna thank you too)
h4r1m4u
@h4r1m4u
Feb 17 2016 14:57
@Savrov here's another one for you http://forismatic.com/en/api/
@dshgna if your browser doesn't support geolocation or have it enabled, all you see is a blank white page
might be a good idea to either have some sort of a fallback, or at least display an error/notification to the user
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:00
@h4r1m4u ah good feedback...Ill show an error message
Andrew Vanboxel
@avanbox
Feb 17 2016 15:00
@dshgna would it be possible to accept a zipcode as an input?
h4r1m4u
@h4r1m4u
Feb 17 2016 15:00
:thumbsup:
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:01
@avanbox you mean for the openweather api?
h4r1m4u
@h4r1m4u
Feb 17 2016 15:01
(alternatively you can use https://ipinfo.io/ to the get the user's IP address and then the location from that)
Andrew Vanboxel
@avanbox
Feb 17 2016 15:02
well if someones browser does not support location, or they deny it, could they instead just put in a zip code?
h4r1m4u
@h4r1m4u
Feb 17 2016 15:03
@avanbox a good idea, but there are too many variations in zip codes (and possibly duplicates). also some countries (like where i live) don't use zip codes at all
Tony Miri
@TonyMiri
Feb 17 2016 15:04
@dshgna No background images? I'm on mobile. Not sure if that makes a difference.
Andrew Vanboxel
@avanbox
Feb 17 2016 15:04
oh yeah. i made the american mistake assumed everyone is from here
h4r1m4u
@h4r1m4u
Feb 17 2016 15:04
:)
Andrew Vanboxel
@avanbox
Feb 17 2016 15:05
ok, I wanted to figure this out myself but im just stuck. My calculator is working ok, but there is a bug. 2+2= works great. The problem occurs when you press 2+2+2 etc. the second operator throws everything off. I did not plan for this occurrence and now I dont know how to fix it. any tips?
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:06
@FatTone225 no background image. bdw is it a requirement?
Tony Miri
@TonyMiri
Feb 17 2016 15:07
@avanbox I think I used an operator flag that gets switched on and off. Not sure how you set yours up but I had two arrays for my equations so it worked out well
h4r1m4u
@h4r1m4u
Feb 17 2016 15:07
This message was deleted
Tony Miri
@TonyMiri
Feb 17 2016 15:07
Lol
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:08
@avanbox: yes openweathermap supports querying from zipcode. Small caveat there though, for the same zipcode may be there for different locations. I remember once I got somewhere in China for my zipcode lol
Andrew Vanboxel
@avanbox
Feb 17 2016 15:08
well ideally Id like to be able to do 2+2+2+2 etc.
Tony Miri
@TonyMiri
Feb 17 2016 15:08
@dshgna I don't remember if it's a requirement but I do think it was mentioned in the video.
@avanbox You can do it with that method
h4r1m4u
@h4r1m4u
Feb 17 2016 15:09
@avanbox evaluate the result after the user presses number / operator / number. this then becomes your "first number" for further operator clicks
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:09
@FatTone225: oh I just went through the text: it says icon or background...but guess I'll do the background too
Tony Miri
@TonyMiri
Feb 17 2016 15:10
@dshgna Never hurts to go the extra mile :smile:
Andrew Vanboxel
@avanbox
Feb 17 2016 15:10
Thats it! Thanks @h4r1m4u sometimes i just cant think. Such a simple solution
CamperBot
@camperbot
Feb 17 2016 15:10
avanbox sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1426 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 17 2016 15:10
no probs
Joseph Morse
@jnmorse
Feb 17 2016 15:10
when I redid my weather app, I added a search bar, you can search by city, course I also redid mine in react, and might tweek it again to use redux at some point
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:11
@FatTone225 yeah and I'm wondering how to set the background image cos as I remember its a css property
is there anyway to change the image that is shown in our codepen portfolio? All mine are empty when I include the elements dynamicallly
Tony Miri
@TonyMiri
Feb 17 2016 15:16
Hmm. I think the preview updates based on probably the default image.
@dshgna I would just set a default and then overwrite it dynamically
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:18
@FatTone225 in case there's no background image? yeah...codepen doesnt show any dynamically appended elements which makes my portfolio look awful lol :(
Tony Miri
@TonyMiri
Feb 17 2016 15:19
And yeah you can set it as an attribute of the div or as a css property.
@dshgna Well I mean just set a default so your previews look better lol
AnnasLab
@AnnasLab
Feb 17 2016 15:21
Hello, In portfolio project I I created 2 principal divs for my page, the first is fixed on the left , the second which will contain the content, I used bootstrap grid to split the second div to 12 col, but it doesn't work, the grid always consider all the page as one div, can anyone help to find a trick to do that (sorry for my english :stuck_out_tongue_winking_eye: )
http://codepen.io/AnnasLab/details/XXQgZj/
Tony Miri
@TonyMiri
Feb 17 2016 15:23
@dshgna also by setting a default background you at least display something if your JS doesn't load
Sandip Subedi
@sandipsubedi
Feb 17 2016 15:27
HI guys .... would you please check my Tic-Tac Toe
and give me some feedback
please
Rune Bak Jacobsen
@runebakjacobsen
Feb 17 2016 15:28
@AnnasLab so you want the nav on the side and the yellow div to be the rest of the content?
Joseph Morse
@jnmorse
Feb 17 2016 15:29
@AnnasLab the head and body tags serve different purposes then what you are using them for. header would be for a page / section header, also you have container-fluid and row wrapping the section you want on the right which is partly why its not on the right
Dulshani Gunawardhana
@dshgna
Feb 17 2016 15:30
@FatTone225 yeah true there :)
AnnasLab
@AnnasLab
Feb 17 2016 15:30
@rune-jacobsen exactly
Rune Bak Jacobsen
@runebakjacobsen
Feb 17 2016 15:30
@AnnasLab When you tell the yellow div that it col-12 then it will fill all of the page
so because the nav fills some of the page i drops to the end of it
so it can spread to fill the entire page
@sandipsubedi when i play and i lose, if i dont press that i want to play again, i can keep play the old game
AnnasLab
@AnnasLab
Feb 17 2016 15:32
@rune-jacobsen so I think that if I need to do something like this bootstrap is not a good choice
Rune Bak Jacobsen
@runebakjacobsen
Feb 17 2016 15:32
@sandipsubedi and i can override the already used fields
@AnnasLab you can use bootstrap but you should see your nav as a col too
thomas-duval
@thomas-duval
Feb 17 2016 15:34
Hey guys,
I'm doing the Wikipedia project and I want to select the text inside an input. Any idea ? I can't remember how to do it using Jquery.
Thanks.
AnnasLab
@AnnasLab
Feb 17 2016 15:34
@rune-jacobsen but I can't give it a fix width, I can just give it 1 unit of the grid
h4r1m4u
@h4r1m4u
Feb 17 2016 15:34
thomas-duval
@thomas-duval
Feb 17 2016 15:35
@h4r1m4u perfect, thanks.
CamperBot
@camperbot
Feb 17 2016 15:35
thomas-duval sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1427 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 17 2016 15:35
np
Rune Bak Jacobsen
@runebakjacobsen
Feb 17 2016 15:36
@AnnasLab you could also give it 2 or 3? I dont think a fixed with would be the best choice to use for the nav
AnnasLab
@AnnasLab
Feb 17 2016 15:37
@rune-jacobsen okay I'll give it try thanks for help have a great day
CamperBot
@camperbot
Feb 17 2016 15:37
annaslab sends brownie points to @rune-jacobsen :sparkles: :thumbsup: :sparkles:
:star: 287 | @rune-jacobsen | http://www.freecodecamp.com/rune-jacobsen
Rune Bak Jacobsen
@runebakjacobsen
Feb 17 2016 15:37
@AnnasLab No worries - put it in the same container if you want it side by side, or else it will also jump down
AnnasLab
@AnnasLab
Feb 17 2016 15:38
@rune-jacobsen Yes i'll make the nav horizental in small screen ;)
Rune Bak Jacobsen
@runebakjacobsen
Feb 17 2016 15:39
Exactly @AnnasLab, think responsive ;)
AnnasLab
@AnnasLab
Feb 17 2016 15:40
@jnmorse thanks bto i'll take your notes in consideration
CamperBot
@camperbot
Feb 17 2016 15:40
annaslab sends brownie points to @jnmorse :sparkles: :thumbsup: :sparkles:
:star: 393 | @jnmorse | http://www.freecodecamp.com/jnmorse
AnnasLab
@AnnasLab
Feb 17 2016 15:41
Thanks guys have a great days :D
Pavel
@Savrov
Feb 17 2016 15:44
Hello again, i have a quote generator here with one issue: after the first opening of page there is no quote. I need to push a Generate button. How i can do it automatically?
http://codepen.io/Savrov/pen/VeNMgP
Goje Samuel Andrei Daniel
@pringon
Feb 17 2016 15:44
can anyone tell me why is it only filtering the first element i click on?
Andrew Vanboxel
@avanbox
Feb 17 2016 15:54
@Savrov I did something like this: $(document).ready(function() {
insertQuote();
Jan Pribošek
@GreatDanton
Feb 17 2016 16:36
!rooms
CamperBot
@camperbot
Feb 17 2016 16:36

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
Chris Hinton
@hintcj
Feb 17 2016 16:38
can someone tell me how to link to my pens in code pen? Whenever I put the URL in, I get a 404 error.
Dick Fink
@dickfink
Feb 17 2016 16:39
@hintcj can you try posting a url?
Andrew Vanboxel
@avanbox
Feb 17 2016 16:40
worked for me
Dick Fink
@dickfink
Feb 17 2016 16:40
me too
Andrew Vanboxel
@avanbox
Feb 17 2016 16:40
if your trying to link to them its better is you replace "pen" with full
Chris Hinton
@hintcj
Feb 17 2016 16:41
Alright, yeah, I don't know what the problem was then. Thank you @dickfink @avanbox
CamperBot
@camperbot
Feb 17 2016 16:41
hintcj sends brownie points to @dickfink and @avanbox :sparkles: :thumbsup: :sparkles:
:star: 208 | @avanbox | http://www.freecodecamp.com/avanbox
:star: 168 | @dickfink | http://www.freecodecamp.com/dickfink
Andrew Vanboxel
@avanbox
Feb 17 2016 16:41
np
Dick Fink
@dickfink
Feb 17 2016 16:41
avanbox — great tip w/ “full"
Chris Hinton
@hintcj
Feb 17 2016 16:41
@avanbox Why does changing to full make a difference?
Dick Fink
@dickfink
Feb 17 2016 16:41
i belive it just changes how it’s displayed (code minimized)
Chris Hinton
@hintcj
Feb 17 2016 16:42
oh okay, that makes sense then. First time using code pen!
Andrew Vanboxel
@avanbox
Feb 17 2016 16:43
yeah it makes it full screen
Dick Fink
@dickfink
Feb 17 2016 17:02
@vizFlux could it have something to do with your countdownCrt() function checking for seconds === 0 and resetting seconds to 59 before executing timeCount()? That seems like it could be problematic….
rodascesar
@cesarrodas
Feb 17 2016 17:06
Im trying to make my navbar button active when you scroll, can someone help?
Dick Fink
@dickfink
Feb 17 2016 17:12

@cesarrodas You’re going to have to detect the scroll position of your page and the (vertical) position of the sections on your page, and then based on that, give the corresponding menu item in your menu a specific class.

http://api.jquery.com/scrollTop/
http://api.jquery.com/position/

Something like this (not tested):

if ( $('body').scrollTop() > $('.section-a').position.top ) {
$('.menu-items').removeClass('selected');
$('.menu-a').addClass('selected');
}

if ( $('body').scrollTop() > $('.section-b').position.top ) {
$('.menu-items').removeClass('selected');
$('.menu-b').addClass('selected');
}

if ( $('body').scrollTop() > $('.section-c').position.top ) {
$('.menu-items').removeClass('selected');
$('.menu-c').addClass('selected');
}

Hiresh
@hiresh
Feb 17 2016 17:15
unable to filter json
       $.getJSON('https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&prop=extracts&exlimit=max&explaintext&exintro&exsentences=1&gsrsearch=suits&callback=?',function(json){
    json = json.filter(function(val) {
  return (val.index !== 1);
});
    $(".message").html(JSON.stringify(json));

      });
I want to filter the entries not having index 1
but no nothing displays, whereas when I simply stringify json, output is as expected, filter seems like ruining the thing, kindly help
Victória Simonetti
@victoriasimonetti
Feb 17 2016 17:19
Hi, how can I put images from my pc in codepen? we need a special account for hosting?
Dick Fink
@dickfink
Feb 17 2016 17:21
@victoriasimonetti you need to host them somewhere online and point to the URL, there are lots of free services which do that (imgur.com comes to mind)
rodascesar
@cesarrodas
Feb 17 2016 17:21
@dickfink thanks, i'm interested in getting mines to work, however. I thought I want close.
CamperBot
@camperbot
Feb 17 2016 17:21
cesarrodas sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 169 | @dickfink | http://www.freecodecamp.com/dickfink
Hiresh
@hiresh
Feb 17 2016 17:22
       $.getJSON('https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&prop=extracts&exlimit=max&explaintext&exintro&exsentences=1&gsrsearch=suits&callback=?',function(json){
    json = json.filter(function(val) {
  return (val.index !== 1);
});
    $(".message").html(JSON.stringify(json));

      });
json is not filtered, help please
Victória Simonetti
@victoriasimonetti
Feb 17 2016 17:23
@dickfink thanks! =)
CamperBot
@camperbot
Feb 17 2016 17:23
victoriasimonetti sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 170 | @dickfink | http://www.freecodecamp.com/dickfink
Hiresh
@hiresh
Feb 17 2016 17:24
is there any1 , who can help?
the index you’re calling in that code indicates " indicates the 0-based position of the element within the unfiltered set of matched elements"

eg if you had a page with a bunch of “li” elements:

$( "li" )
  .filter(function( index ) {
    return index % 3 === 2;
  })
    .css( "background-color", "red" );

would cause third and sixth list items to be highlighted.

i think you need to iterate through each of the “pages” object and filter out the one that has pages.index === 1
(but i’m just learning too, so take what i say with a grain of salt)
Maulik Darji
@maulikdarji
Feb 17 2016 17:30
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:31

Hi i need help in the Weather app zipline
I dont get a response from the openweather api, if i put the urrl in the browser searchbar it loads but when i call it with the ajax jquery function i get nothing.
Here is my code:



$(document).ready(function(){

  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position){
      var apiUrl= "api.openweathermap.org/data/2.5/weather?lat="+ position.coords.latitude + "&lon=" + position.coords.longitude + "&units=metric&APPID=388b9dfad805b961ba54355aedb86991"
     $.ajax({
       url:apiUrl,
       success: function(weather){
         console.log(weather);
       },

     })
    });

  }else {
    $('#location-header').html('Geolocation is not available')
  };


});

Thanks
Here is the pen link: http://codepen.io/SpiralOut17/pen/XXQmxM?editors=0011

Lanitta
@DivaWeb
Feb 17 2016 17:40
hello all
how is everyone today?
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:41
@DivaWeb Great! you?
LDiek-
@LDiek-
Feb 17 2016 17:41
i have got a problem programming the weather app
i cant get my longtitude
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:41
@LDiek- Im working on that ziplite too
Lanitta
@DivaWeb
Feb 17 2016 17:42
@SpiralOut17 lol I almost through my computer through the window over a space in my code lolololololo
LDiek-
@LDiek-
Feb 17 2016 17:42
@SpiralOut17 i've seen it in CodeReview :D
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:42
@LDiek- Haha i just solved that problem i had
LDiek-
@LDiek-
Feb 17 2016 17:43
what was the problem?
@SpiralOut17
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:44
@LDiek- I couldnt get the JSON from the api because i was missing // at the beggining of the url
@LDiek- I was going nuts
LDiek-
@LDiek-
Feb 17 2016 17:46
@SpiralOut17 do i need the // always in js urls?
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:47
@LDiek- apparently it allows either http and https so it works with either
LDiek-
@LDiek-
Feb 17 2016 17:48
hmm ok thx
Hiresh
@hiresh
Feb 17 2016 17:48
@dickfink but the error I am facing in console is "filter is not a function"
LDiek-
@LDiek-
Feb 17 2016 17:50

@SpiralOut17 I dont get any longtitude nor an output in the div with the class "weather".This is my code:`function printweather(pos) {
var lon = pos.coords.longtitude;
var lat = pos.coords.latitude;

var url = "//api.openweathermap.org/data/2.5/weather?lat="; + lat + "&lon=" + lon + "&units=metric&APPID=6ffb926f18657b3913623a729923200f";
$.getJSON(url, function(data) {
$(".weather").html(data);
});
}

$(document).ready(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(printweather);
}
});`

function printweather(pos) {
var lon = pos.coords.longtitude;
var lat = pos.coords.latitude;

var url = "//api.openweathermap.org/data/2.5/weather?lat="; + lat + "&lon=" + lon + "&units=metric&APPID=6ffb926f18657b3913623a729923200f";
$.getJSON(url, function(data) {
$(".weather").html(data);
});
}

$(document).ready(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(printweather);
}
});
oh the indents are gone :O
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:54
@LDiek- You are not getting output because you are not getting nothing from the api since the lon variable is empty
LDiek-
@LDiek-
Feb 17 2016 17:54
@SpiralOut17 do you have an idea why lon could be empty?
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 17:56
@LDiek- Try using the position.coords.longitude and dont use the variables in the url
@LDiek- you can put the var url within the if statement and call the api from there
LDiek-
@LDiek-
Feb 17 2016 18:03
@SpiralOut17 ok i have got an output now... i just had to stringify the data object :D
but still i have got the {"cod":"404","message":"Error: Not found city"} message @SpiralOut17
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 18:04
@LDiek- Did you get de longitude?
LDiek-
@LDiek-
Feb 17 2016 18:05
no
@SpiralOut17 i just spelled longitude longtitude... thanks for your help!:D
CamperBot
@camperbot
Feb 17 2016 18:08
ldiek- sends brownie points to @spiralout17 :sparkles: :thumbsup: :sparkles:
:star: 279 | @spiralout17 | http://www.freecodecamp.com/spiralout17
Wenceslao Villegas Marset
@SpiralOut17
Feb 17 2016 18:08
This message was deleted
@LDiek- You are welcome! Havea nice day
Mafalda
@otmeek
Feb 17 2016 18:23
I just can't understand how to implemente the minimax algorithm in my tic tac toe game
it just feels like the way I've structure my code is not compatible with the algorithm at all and I'm not sure how to rebuild it
modus81
@modus81
Feb 17 2016 18:39
Hey Guys ...new guy just dropping a line
Drew
@andrewp89
Feb 17 2016 18:54

hey guys can someone please point me in the direction to fix my quote button |

http://codepen.io/drewpiper/pen/BjbjOW/?editors=0110

looking at how to get rid of that blue border when i click it, thank you

kirbyedy
@kirbyedy
Feb 17 2016 18:56
@andrewp89 outline:none;
h4r1m4u
@h4r1m4u
Feb 17 2016 18:56
@andrewp89 .btn:focus {outline: none;}
This message was deleted
Aiden Buis
@Aidenbuis
Feb 17 2016 18:57
@andrewp89 Hi Andrew, outline: none; will indeed solve your problem, but keep in mind that the outline also serves users with a screenreader
Drew
@andrewp89
Feb 17 2016 18:58
thanks guys!! been pulling my hair out for a bit :+1:
Joseph
@HadziJo
Feb 17 2016 19:02
hello peoples!
If anyone knows how ot convince CodePen to display an image (the <img> tag works well if browsing locally) I would appreciate getting a clue or two. I even tried adding the 'target="_blank"' trick used for the anchor tag <a href= ...>. Thanks in advance!
.o0( looks empty here, I guess I'll stop by again later)
Drew
@andrewp89
Feb 17 2016 19:10
what do you mean?
Cooper Reck
@cooperreck
Feb 17 2016 19:13
hey guys I'm working on the dedication page an am trying to center an image, anyone know how that would work?
Daniel Ross
@gainiacster
Feb 17 2016 19:14
@andrewp89 you can use bootstrap and add the class text-center
Robert Uivarosi
@URobert
Feb 17 2016 19:16
@cooperreck you could use bootstrap, or use a div wrapper, then mod the class like `.wrapper{text-align:center;} - that should do it
Aiden Buis
@Aidenbuis
Feb 17 2016 19:17
Yes, and study this post to be safe & sound in the future: https://css-tricks.com/centering-css-complete-guide/
Centering in CSS can be a B*tch ;)
Robert Uivarosi
@URobert
Feb 17 2016 19:19
@cooperreck Here is a finddle on how to do it: https://jsfiddle.net/66oxm294/
Cooper Reck
@cooperreck
Feb 17 2016 19:20
@URobert @Aidenbuis Thanks guys!
CamperBot
@camperbot
Feb 17 2016 19:20
cooperreck sends brownie points to @urobert and @aidenbuis :sparkles: :thumbsup: :sparkles:
:star: 593 | @urobert | http://www.freecodecamp.com/urobert
:star: 134 | @aidenbuis | http://www.freecodecamp.com/aidenbuis
Robert Uivarosi
@URobert
Feb 17 2016 19:20
@cooperreck yw
Drew
@andrewp89
Feb 17 2016 19:21
hey guys i tried putting btn:focus {outline:none;} but it doesnt seem to work (Also tried to add outline:none into my other .btn's and also outline:0; (as per google serach) but still getting that box on my button. thanks guys http://codepen.io/drewpiper/pen/MKRVzy
Shakib Hossain
@shakib609
Feb 17 2016 19:22
Hey just made this tribute page... Please tell me what should I do to make it look better? http://codepen.io/shakib609/full/jWRyQE/
Aiden Buis
@Aidenbuis
Feb 17 2016 19:25
@andrewp89 Add !important, outline: none !important;
Craig Banach
@CraigBanach
Feb 17 2016 19:25
@andrewp89 I suggest you fulfill the user stories before attempting to personalise it.
Shakib Hossain
@shakib609
Feb 17 2016 19:27
Made some minor changes. http://codepen.io/shakib609/full/jWRyQE/
wyattelliott
@wyattwade
Feb 17 2016 19:27
yoyooooooo!
Aiden Buis
@Aidenbuis
Feb 17 2016 19:28
@shakib609 Hi Shakib, some design questions: the blue nav has a huge height in comparison to the logo and the nav items, you could play with the font size and the line-height to vertically center them. I also sugget u make them inline by using only 1 row. Last point, the box shadow is not subtle, you can check out Google’s Material design and how they use shadows (They the boxshadowbosses)
@wyattwade Wasssup
Drew
@andrewp89
Feb 17 2016 19:29
@Aidenbuis champion!!
wyattelliott
@wyattwade
Feb 17 2016 19:30
@Aidenbuis hangin out man... just been working on this project for so long
Shakib Hossain
@shakib609
Feb 17 2016 19:30
Changed the nav to use a single row.. I'll have to look about the box shadow. @Aidenbuis thanks
CamperBot
@camperbot
Feb 17 2016 19:30
shakib609 sends brownie points to @aidenbuis :sparkles: :thumbsup: :sparkles:
:star: 135 | @aidenbuis | http://www.freecodecamp.com/aidenbuis
wyattelliott
@wyattwade
Feb 17 2016 19:30
Tic Tac Toe
I think it's done. If anyone is able to beat it or has any criticism, it's much appreciated
Aiden Buis
@Aidenbuis
Feb 17 2016 19:31
@wyattwade Aiii I didn’t do that one yet, let me see !
wyattelliott
@wyattwade
Feb 17 2016 19:32
thanks man @Aidenbuis . This one took a while for whatever reason
CamperBot
@camperbot
Feb 17 2016 19:32
wyattwade sends brownie points to @aidenbuis :sparkles: :thumbsup: :sparkles:
:star: 136 | @aidenbuis | http://www.freecodecamp.com/aidenbuis
kirbyedy
@kirbyedy
Feb 17 2016 19:34
@wyattwade there is a bug
check the image
Screen Shot 2016-02-17 at 21.33.42.png
this happened in the middle of the game
Shakib Hossain
@shakib609
Feb 17 2016 19:37
Changed the box shadow to use the mdl's default box-shadow class http://codepen.io/shakib609/full/jWRyQE/
wyattelliott
@wyattwade
Feb 17 2016 19:41
@kirbyedy oops lemme get rid of that. Was using that for testing my bad
Ok I just updated/saved it
thanks for taking a look @kirbyedy . Fixed that. Let me know if you find anything else
CamperBot
@camperbot
Feb 17 2016 19:43
wyattwade sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 492 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
George Carroll
@ghcarrolljr
Feb 17 2016 19:45
I am working on Accessing Nested Arrays in JSON and could use some help. Don't know how to pick an object from a nested object.
Craig Banach
@CraigBanach
Feb 17 2016 19:46
@ghcarrolljr Ok, post your formatted code and we'll have a look.
help format
CamperBot
@camperbot
Feb 17 2016 19:46

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

George Carroll
@ghcarrolljr
Feb 17 2016 19:48
This is what I have so far "var secondTree = myPlants.type[trees].list1;" but does not work. any help?
Craig Banach
@CraigBanach
Feb 17 2016 19:48
@ghcarrolljr maybe if you post all your code we can.
George Carroll
@ghcarrolljr
Feb 17 2016 19:49

// Setup
var myPlants = [
{
type: "flowers",
list: [
"rose",
"tulip",
"dandelion"
]
},
{
type: "trees",
list: [
"fir",
"pine",
"birch"
]
}
];

// Only change code below this line

var secondTree = myPlants.type.trees.list[1]; // Change this line

Craig Banach
@CraigBanach
Feb 17 2016 19:50
@ghcarrolljr can you post your formatted code as requested please
help format
CamperBot
@camperbot
Feb 17 2016 19:50

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

ronald
@ronstarcool
Feb 17 2016 19:57
hello
can someone help me drive my car?
its the green vehicle on the right side of the screen
if i click it, it does drive around the bend
but it doesnt move forward
it should
George Carroll
@ghcarrolljr
Feb 17 2016 20:01
@cragsify

@cragsify // Setup
var myPlants = [
{
type: "flowers",
list: [
"rose",
"tulip",
"dandelion"
]
},
{
type: "trees",
list: [
"fir",
"pine",
"birch"
]
}
];

// Only change code below this line

var secondTree = myPlants.type.trees.list[1]; // Change this line

Craig Banach
@CraigBanach
Feb 17 2016 20:01
 // Setup
var myPlants = [
{
type: "flowers",
list: [
"rose",
"tulip",
"dandelion"
]
},
{
type: "trees",
list: [
"fir",
"pine",
"birch"
]
}
];
// Only change code below this line
var secondTree = myPlants.type.trees.list[1]; // Change this line
sigh...
@ghcarrolljr ok, since I don't know what the challenge is I don't know what you are trying to do.
wyattelliott
@wyattwade
Feb 17 2016 20:02
Hey guys
if anyone has a chance can you check out my project
Craig Banach
@CraigBanach
Feb 17 2016 20:02
@ghcarrolljr myPlants.type == "flowers" and has no trees property.
criticism is much appreciated
and please let me know if you can beat it. That means there's a bug
Lanitta
@DivaWeb
Feb 17 2016 20:04
ok I need something explained to me about bootstrap
George Carroll
@ghcarrolljr
Feb 17 2016 20:05
@cragsify write a variable that gets the second tree in the tree list
Lanitta
@DivaWeb
Feb 17 2016 20:06
does a container in bootstrap have default sizes?
Craig Banach
@CraigBanach
Feb 17 2016 20:09
@ghcarrolljr OK, so you know that the object has two nested arrays.
ronald
@ronstarcool
Feb 17 2016 20:09
@wyattwade i cant beat it. but there is somthing wrong. sometimes, comp skips a move. so player can go twice
Craig Banach
@CraigBanach
Feb 17 2016 20:10
And you want to access the second array and then the second object within that arary. @ghcarrolljr
R. E. Daniels
@RDaniels34
Feb 17 2016 20:10
Hey all... Was hoping someone could help with my weather app... I''m almost there. Having trouble changing the city. I'm trying to do it with url.replace(city, newcity)... Any help would be appreciated! http://codepen.io/RDaniels34/pen/zreZwy
Craig Banach
@CraigBanach
Feb 17 2016 20:12
@RDaniels34 Why do you want to view cities location? The user story states that you need to show the weather at the current location?
wyattelliott
@wyattwade
Feb 17 2016 20:13
crap
R. E. Daniels
@RDaniels34
Feb 17 2016 20:13
@cragsify I can get the weather for my location just by putting the name in, but I want anyone who wants to see their location to enter a city name and have it come up..
wyattelliott
@wyattwade
Feb 17 2016 20:13
thanks @ronstarcool I'll check that out
CamperBot
@camperbot
Feb 17 2016 20:13
wyattwade sends brownie points to @ronstarcool :sparkles: :thumbsup: :sparkles:
:star: 329 | @ronstarcool | http://www.freecodecamp.com/ronstarcool
Craig Banach
@CraigBanach
Feb 17 2016 20:14
@RDaniels34 Why don't you just use geo-location to enable people to view the weather at their location?
wyattelliott
@wyattwade
Feb 17 2016 20:14
@ronstarcool crap it just happened I see what you me an
R. E. Daniels
@RDaniels34
Feb 17 2016 20:15
@cragsify what if they want to see the weather somewhere else?
Craig Banach
@CraigBanach
Feb 17 2016 20:15
@RDaniels34 Also how are you handling people that input the cities name differently than the API asks?
@RDaniels34 let them put in the coords
Sandip Subedi
@sandipsubedi
Feb 17 2016 20:16
@rune-jacobsen thank you ... fixed both of them
CamperBot
@camperbot
Feb 17 2016 20:16
sandipsubedi sends brownie points to @rune-jacobsen :sparkles: :thumbsup: :sparkles:
:star: 288 | @rune-jacobsen | http://www.freecodecamp.com/rune-jacobsen
R. E. Daniels
@RDaniels34
Feb 17 2016 20:16
@cragsify Does anyone you know know what their coords are?
@cragsify What are the coords for Tucson?
Craig Banach
@CraigBanach
Feb 17 2016 20:17
@RDaniels34 32.2217° N, 110.9264° W
Gabriel
@Zera99
Feb 17 2016 20:18
How do I link a picture in dropbox to put it in a img tag?
R. E. Daniels
@RDaniels34
Feb 17 2016 20:18
@cragsify I want to do it my way, if you can't help then...
Craig Banach
@CraigBanach
Feb 17 2016 20:18
@RDaniels34 I don't know how to get it to give me the weather in my City, Perth, Scotland, given that if I type inPerth, it will take me to Australia, but I know how to find my coords and input them.
R. E. Daniels
@RDaniels34
Feb 17 2016 20:19
@cragsify you just us UK in the json
@RDaniels34 use
@cragsify or at least the country code for Scotland
Catalin Scripcariu
@CatalinScr
Feb 17 2016 20:20
@Zera99 I used http://tinypic.com/
Craig Banach
@CraigBanach
Feb 17 2016 20:20
@RDaniels34 If you want to pull data from your input field, then you will need to add an on-clcik listener to the button and disable the loading of the page when the button is clicked.
R. E. Daniels
@RDaniels34
Feb 17 2016 20:22
@cragsify so my onclick event would be outside the onready function?
Craig Banach
@CraigBanach
Feb 17 2016 20:23
@RDaniels34 inside.
R. E. Daniels
@RDaniels34
Feb 17 2016 20:23
or document.ready function
@cragsify it is inside already
George Carroll
@ghcarrolljr
Feb 17 2016 20:24
@cragsify Sorry was out for a min. Yes and Yes.
Craig Banach
@CraigBanach
Feb 17 2016 20:24
@RDaniels34 I tested it, it doesn't work.
@ghcarrolljr So can you think of a way to access entries within an array?
@Zera99 link me the image please?
Gabriel
@Zera99
Feb 17 2016 20:25
I did it ^^ Thanks though. @cragsify
CamperBot
@camperbot
Feb 17 2016 20:25
zera99 sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 316 | @cragsify | http://www.freecodecamp.com/cragsify
George Carroll
@ghcarrolljr
Feb 17 2016 20:26
@cragsify arrayName[position]
Craig Banach
@CraigBanach
Feb 17 2016 20:26
@ghcarrolljr ok ,so do that in your code. access the 2nd array, then the 2nd array again.
R. E. Daniels
@RDaniels34
Feb 17 2016 20:26
@cragsify I know it doesn't work. That's why I came here to the chat.
Craig Banach
@CraigBanach
Feb 17 2016 20:27
@RDaniels34 OK, I'd recommend putting the event listener in you JS and linkin to the element by reference to it's ID.
George Carroll
@ghcarrolljr
Feb 17 2016 20:27
@cragsify ?
R. E. Daniels
@RDaniels34
Feb 17 2016 20:27
@cragsify I'll give that a try....
wyattelliott
@wyattwade
Feb 17 2016 20:28
@ronstarcool k fixed that issue
hajeansonne
@hajeansonne
Feb 17 2016 20:28
Ok this may be another stupid question... for the portfolio zipline, do I HAVE to have a nav bar that stays at the top as you scroll down, or can i just have buttons that link to each section of the page
wyattelliott
@wyattwade
Feb 17 2016 20:28
If anyone can beat this pleeasee let me know
George Carroll
@ghcarrolljr
Feb 17 2016 20:28
@cragsify Waht is the first array? type
wyattelliott
@wyattwade
Feb 17 2016 20:28
or if you have any criticism
ronald
@ronstarcool
Feb 17 2016 20:28
good job @wyattwade
not sure :)
Craig Banach
@CraigBanach
Feb 17 2016 20:28
@ghcarrolljr myPlants
wyattelliott
@wyattwade
Feb 17 2016 20:28
@ronstarcool i thiiiiink i fixed the issue
did about 20 test runs
George Carroll
@ghcarrolljr
Feb 17 2016 20:29
@cragsify so what is the second?
Craig Banach
@CraigBanach
Feb 17 2016 20:29
@hajeansonne What do the user stories say.
ronald
@ronstarcool
Feb 17 2016 20:29
y, you fixed it
nice gameflow!
Craig Banach
@CraigBanach
Feb 17 2016 20:30
@ghcarrolljr If you use myPlants[1] then you are inside the 2nd element in the main array, then if you do [1], you will access the 2nd, 2nd element
hajeansonne
@hajeansonne
Feb 17 2016 20:30
@cragsify I navigate to different sections of the webpage by clicking buttons in the navigation, by "in the navigation" do they mean nav bar?
Craig Banach
@CraigBanach
Feb 17 2016 20:30
@ghcarrolljr
myPlants[1][1]
@hajeansonne That's open to interpretation i suppose.
wyattelliott
@wyattwade
Feb 17 2016 20:31
@ronstarcool thank you man
CamperBot
@camperbot
Feb 17 2016 20:31
wyattwade sends brownie points to @ronstarcool :sparkles: :thumbsup: :sparkles:
:warning: wyattwade already gave ronstarcool points
hajeansonne
@hajeansonne
Feb 17 2016 20:31
@cragsify god i hope so, i just put so much work into the home section
wyattelliott
@wyattwade
Feb 17 2016 20:31
I have to send this project in for an application
just want to make sure it works alright
hajeansonne
@hajeansonne
Feb 17 2016 20:31
@cragsify thank you
CamperBot
@camperbot
Feb 17 2016 20:31
hajeansonne sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 317 | @cragsify | http://www.freecodecamp.com/cragsify
Craig Banach
@CraigBanach
Feb 17 2016 20:32
@ghcarrolljr what I did was
var secondTree = myPlants[1].list[1];
George Carroll
@ghcarrolljr
Feb 17 2016 20:39
@cragsify thanks
Caleb Martin
@caleb272
Feb 17 2016 20:43
how do you put multiple style elements into a inline style like this style="margin-top: 40px"
Craig Banach
@CraigBanach
Feb 17 2016 20:44
@caleb272 leave a space between them.
@caleb272 although it is bad practice.
Caleb Martin
@caleb272
Feb 17 2016 20:44
o ok
i guess i will just create a css element
Craig Banach
@CraigBanach
Feb 17 2016 20:44
@caleb272 I would advise it :D
Lanitta
@DivaWeb
Feb 17 2016 20:45
why do I have an odd man out? http://codepen.io/DivaWeb/pen/XXOdEX
it is in section 3
Caleb Martin
@caleb272
Feb 17 2016 20:46
wow that looks good divaWeb
Lanitta
@DivaWeb
Feb 17 2016 20:46
@caleb272 thank you but it is still a work in progress lolol
CamperBot
@camperbot
Feb 17 2016 20:46
divaweb sends brownie points to @caleb272 :sparkles: :thumbsup: :sparkles:
:star: 132 | @caleb272 | http://www.freecodecamp.com/caleb272
zackluckyf
@zackluckyf
Feb 17 2016 20:49
https://htmlpreview.github.io/?https://github.com/zackluckyf/random-quote-machine/blob/master/Random-Quote-Generator/index.html
Random quote machine completed except for the fact that all the quotes are hard programmed in js and not from an api. I know nothing of how to do that, should I go learn some php and ajax to be able to do it all?
Craig Banach
@CraigBanach
Feb 17 2016 20:49
@zackluckyf just do it in JS.
zackluckyf
@zackluckyf
Feb 17 2016 20:52
@cragsify I'm not sure where to start is there a resource to learn about api's and how to use them?
Craig Banach
@CraigBanach
Feb 17 2016 20:53
@zackluckyf each api is slightly different. What i would aim to learn is the way of sending get requests, such as jQuery's $.get and $.ajax
George
@gxenos
Feb 17 2016 20:53
guys i uploaded images to imgur to use in my codepen and when i go full page view they dont load.any idea why?
Craig Banach
@CraigBanach
Feb 17 2016 20:53
@gxenos post your codepen link
zackluckyf
@zackluckyf
Feb 17 2016 20:54
@cragsify okay I'll give that a go, thank you
CamperBot
@camperbot
Feb 17 2016 20:54
zackluckyf sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 318 | @cragsify | http://www.freecodecamp.com/cragsify
Cooper Reck
@cooperreck
Feb 17 2016 20:57
So I want to change the text under the picture independently from the main text but they are only changing together, can someone help? http://codepen.io/Cjreck/pen/PZLrpy?editors=1100
Craig Banach
@CraigBanach
Feb 17 2016 20:57
@gxenos It workds for me.
George
@gxenos
Feb 17 2016 20:57
can you open it in a new tab and check it?
Craig Banach
@CraigBanach
Feb 17 2016 20:58
@cooperreck color: black;
@cooperreck not text-color:black;
@gxenos I have.
George
@gxenos
Feb 17 2016 20:59
@cragsify well,when i refresh it,the images get lost
Sloth
@RMo-Sloth
Feb 17 2016 20:59
@cooperreck place the image and paragraph in a div, style the div.
Cooper Reck
@cooperreck
Feb 17 2016 21:00
@cragsify Thank You!!1
CamperBot
@camperbot
Feb 17 2016 21:00
cooperreck sends brownie points to @cragsify :sparkles: :thumbsup: :sparkles:
:star: 320 | @cragsify | http://www.freecodecamp.com/cragsify
Dick Fink
@dickfink
Feb 17 2016 21:01
@gxenos it seems to work intermittantly — but i think you should wrap the url in quotes in your css
Caleb Martin
@caleb272
Feb 17 2016 21:04
nice green color i hope you don’t mind me stealing it for my project
can someone check out my project http://codepen.io/thecoder15/full/wMZgVw/
Brett Felts
@brettfelts
Feb 17 2016 21:05
I'm working on the wikipedia app. Does anyone know how to add the Access-Control-Allow-Origin hedaer for that?
George
@gxenos
Feb 17 2016 21:06
@dickfink alright,i fixed it,i uploaded them in imageshack instead.Do you like it though?
Caleb Martin
@caleb272
Feb 17 2016 21:08
does anyone here live in Montana
LDiek-
@LDiek-
Feb 17 2016 21:10
hi how do i get the table borders completely transparent? http://codepen.io/LDiek-/full/PZgQwG/
Dick Fink
@dickfink
Feb 17 2016 21:12
@gxenos yup, that works now. there’s a lot of un-used verticle whitespace (but if you like it go for it!), and the social buttons act oddly when the window is narrow. Otherwise it looks very nice (much nicer than mine)
George
@gxenos
Feb 17 2016 21:13
@dickfink yeah its not responsive
@dickfink i like its simplicity
Cooper Reck
@cooperreck
Feb 17 2016 21:15
now does anyone know how I would center the image of Bowie and the facts below him? http://codepen.io/Cjreck/pen/PZLrpy?editors=1100
Jack Lyons
@JackEdwardLyons
Feb 17 2016 21:16
hmm i tried that @wearenotgroot and didn't seem to change things...
still says 59:59...
Brett Felts
@brettfelts
Feb 17 2016 21:17
@cooperreck Try text-align: center; in .mainBody
Jack Lyons
@JackEdwardLyons
Feb 17 2016 21:19
actually i got it work @wearenotgroot thanks for the help :)
CamperBot
@camperbot
Feb 17 2016 21:19
jackedwardlyons sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
api offline
Cooper Reck
@cooperreck
Feb 17 2016 21:20
@brettfelts Ah doing that centers the text of the facts but keeps the list on the right
Brett Felts
@brettfelts
Feb 17 2016 21:25
you can add ul to the beginning of .list, then add a text-align: center to that. It will center the text, but leave the bullet points on the left
hmm.
@cooperreck On the other hand: .list {
margin-left: 6.5%;
text-align: justify;
list-style-type: square;
font-family: Times New Roman;
font-size: 18px;
width: 700px;
}
Sujit Karki
@Swoozeki
Feb 17 2016 21:35
Time to start the weather challenge. I am so nervous
Brett Felts
@brettfelts
Feb 17 2016 21:36
@Swoozeki You got this! It took me a few days, but once I realized my problems were just an extra if statement, it all made sense
Caleb Martin
@caleb272
Feb 17 2016 21:39
can someone check out my project http://codepen.io/thecoder15/full/wMZgVw/
Cooper Reck
@cooperreck
Feb 17 2016 21:40
That looks much better, thanks! @brettfelts
CamperBot
@camperbot
Feb 17 2016 21:40
cooperreck sends brownie points to @brettfelts :sparkles: :thumbsup: :sparkles:
:star: 360 | @brettfelts | http://www.freecodecamp.com/brettfelts
hajeansonne
@hajeansonne
Feb 17 2016 21:42
So I used position:absolute to position links over particular parts of the background image, and when I go to full page view, they are no longer where I want them. I am VERY new to this and I am not sure how to fix this
zackluckyf
@zackluckyf
Feb 17 2016 21:42
any api recommendations for the random quote machine?
Brett Felts
@brettfelts
Feb 17 2016 21:42
@cooperreck No problem. If it has trouble when responsive, try setting the left and right margins to the same amount
@caleb272 I would suggest adding a bit of padding around your text, and making it a bit smaller
the list items are a bit overwhelming
Andrew Vanboxel
@avanbox
Feb 17 2016 21:44
so ive been working on this calculator, think im done, go to submit it and the project is gone from the map?
Sujit Karki
@Swoozeki
Feb 17 2016 21:45
@hajeansonne instead of using px or em, use %
George
@gxenos
Feb 17 2016 21:45
@caleb272 nice work man.you can maybe try to change the a tag text color
Andrew Vanboxel
@avanbox
Feb 17 2016 21:45
@zackluckyf i just used an array
Sujit Karki
@Swoozeki
Feb 17 2016 21:46
@avanbox Calculator's been moved from basic front-end to intermediate front-end, I think
Andrew Vanboxel
@avanbox
Feb 17 2016 21:46
oh really? Guess I got a head start then haha
it must have moved while i was working on it
Sujit Karki
@Swoozeki
Feb 17 2016 21:47
Yup, congrats :D Your learning curve is going to appreciate it
wyattelliott
@wyattwade
Feb 17 2016 21:50
Hey guys
I'm about to submit my tic tac toe challenge for an application
AnnasLab
@AnnasLab
Feb 17 2016 21:50
Yoo whssup campers ^^, anyone know how to use local font file on codepen something like host the files on dropbox work ?
wyattelliott
@wyattwade
Feb 17 2016 21:50
anyones critissm is much appreciated
Mariya
@mariyadiminsky
Feb 17 2016 21:51
I'm trying to create an indexOf function for an assignment and for some reason my checkDuplicate object always shows the array item = NaN, like the +1 in the for loop isn't working. Why doesn't it work and how can I fix this issue? Advice appreciated :)
indexOf([11,33, 22,33], 33); 
2    
3    function indexOf(array, value) {
4        var result = -1;
5        var checkDuplicate = {};
6        
7        for(var i = 0; i < array.length; i++) {
8            if(array[i] === value) {
9                checkDuplicate[array[i]] += 1;
10                if(checkDuplicate[array[i]] !== 1) {
11                    result = i;
12                }
13            }
14        }
15        
16        return result;
17    
18    }
Where my error is: http://goo.gl/BmkhUc
hajeansonne
@hajeansonne
Feb 17 2016 21:52
@Swoozeki its not as bad, but still moves out of alignment with the background
criticism much appreciated
if you can beat it pleeasee let me knwo
Mariya
@mariyadiminsky
Feb 17 2016 21:54
updated code
indexOf([11,33, 22,33], 33); 

function indexOf(array, value) {
    var result = -1;
    var checkDuplicate = {};

    for(var i = 0; i < array.length; i++) {
        if(array[i] === value) {
            checkDuplicate[array[i]] += 1;
            if(checkDuplicate[array[i]] > 1) {
                result = i;
            }
        }
    }

    return result;

}
Mariya
@mariyadiminsky
Feb 17 2016 22:01
nvm ty :)
hajeansonne
@hajeansonne
Feb 17 2016 22:06
I think some of the problem I had with links moving when I went into page view, has something to do with the editor layout that i was using, is that possible?
kiel barry
@kielbarry
Feb 17 2016 22:16
 <div class="navi">
          <ul>
                      <li>About</li>
            <li>Work</li>
            <li>Team</li>