These are chat archives for FreeCodeCamp/HelpFrontEnd

30th
Jan 2017
taltmann42
@taltmann42
Jan 30 2017 00:00
http://www.9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/ - sorry if I just post a link-answer but that's quite a lot to explain from scratch if there are already a bunch of tutorials out there
anapandey
@anapandey
Jan 30 2017 00:01
Thanks @taltmann42 , I'll sure go through it
CamperBot
@camperbot
Jan 30 2017 00:01
anapandey sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 411 | @taltmann42 |http://www.freecodecamp.com/taltmann42
Jasmin Parent
@charlesdarkwind
Jan 30 2017 00:11
Hi, I need to add transition.js and colapse.js from bootstrap in codepen, I can I do this?
how can*
taltmann42
@taltmann42
Jan 30 2017 00:13
@charlesdarkwind click on the little gear next to "JS" and paste the link in "Add external resources"
Alexandar Castaneda
@alexthedar
Jan 30 2017 00:14
Anyone have opinion about SusySass versus BourbonSass? Also, curious on if there is a easy way to incorporate material design with either Sass framework? Or is it just a matter of following the design rules of material design when dealing with those sass frameworks?
Jasmin Parent
@charlesdarkwind
Jan 30 2017 00:15
@taltmann42
Gulsvi
@gulsvi
Jan 30 2017 00:15
@charlesdarkwind The easiest way to get those is to just use bootsrap.js, they're all included: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
Jasmin Parent
@charlesdarkwind
Jan 30 2017 00:16
ah ok, I wasnt sure, thanks
avicohen123
@avicohen123
Jan 30 2017 00:18
Hi, I'm having issues with the weather app project. I am trying to get the open weather API. I am using a hard coded url for testing purposes but still can't get the api to load the data. If someone could please take a look at my js and possibly let me know what I'm doing wrong that would be fantastic
Johnny
@JohnnyBizzel
Jan 30 2017 00:20
@avicohen123 getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details. is coming up
Consider using an IP address API
avicohen123
@avicohen123
Jan 30 2017 00:21
@JohnnyBizzel didn't know that, will switch. Thanks
CamperBot
@camperbot
Jan 30 2017 00:21
avicohen123 sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:star2: 1204 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Jan 30 2017 00:22
@avicohen123 For example: http://ip-api.com/json
@avicohen123 2nd issue: Uncaught Error: Bootstrap's JavaScript requires jQuery
avicohen123
@avicohen123
Jan 30 2017 00:23
thanks for the first api
for the second issue, I'm unsure what that entails
do i need to add another external js to codepen
Johnny
@JohnnyBizzel
Jan 30 2017 00:26
@avicohen123 A few more issues found...http://codepen.io/JohnnyBizzel/pen/RKxrQr
@avicohen123 The order is important. Put the reference to jQuery before that of Bootstrap (for JS).
I have fixed the problems in the above pen ^^
Gururaj Birajdar
@grajsb
Jan 30 2017 00:27
@JohnnyBizzel that is a good api
Johnny
@JohnnyBizzel
Jan 30 2017 00:27
@avicohen123 You had a h1 and /h3 tag - tags must match
@grajsb One of many available!
avicohen123
@avicohen123
Jan 30 2017 00:28
@JohnnyBizzel ahhh awesome. Can you explain why the order matters?
and lol, that's my bad with the h1 and h3 tag, was so caught up trying to get the weather api to work. spent about 2 hours on it before i threw in the towel
Johnny
@JohnnyBizzel
Jan 30 2017 00:29
@avicohen123 The definitions in jQuery need to be loaded before you can use them.
Gururaj Birajdar
@grajsb
Jan 30 2017 00:31
I have Wikipedia app i need help with...
Can you please help me?
Johnny
@JohnnyBizzel
Jan 30 2017 00:32
source.png
Gururaj Birajdar
@grajsb
Jan 30 2017 00:33
My first search works fine...however my second search appends the search text to the previous search text cannot figure out what am i doing wrong
Johnny
@JohnnyBizzel
Jan 30 2017 00:33
@avicohen123 this is your codepen source code. Notice how jQuery is loaded 1st. Otherwise all following functions would not understand the jQuery syntax.
avicohen123
@avicohen123
Jan 30 2017 00:34
ahhhhh understood. @JohnnyBizzel thanks again
CamperBot
@camperbot
Jan 30 2017 00:34
avicohen123 sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:warning: avicohen123 already gave johnnybizzel points
Johnny
@JohnnyBizzel
Jan 30 2017 00:37
@grajsb You have this in your code: callBackUrl += searchTerm;
Which will keep appending.
avicohen123
@avicohen123
Jan 30 2017 00:38
@JohnnyBizzel sorry to bother you again but i tried changing my code to fix the issues you mentioned and still had the same issue so i copied ur js into mine and still the temperature wouldn't show. I triple checked to make sure that jquery was the first listed and even removed bootstrap
do you mind taking one more look: https://codepen.io/acohen102/pen/zNpOKx
Gururaj Birajdar
@grajsb
Jan 30 2017 00:40
@JohnnyBizzel ohhh...damn me...thank you i just fixed it by setting the callBackUrl again in the submit function
thanks @JohnnyBizzel
CamperBot
@camperbot
Jan 30 2017 00:42
grajsb sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:star2: 1205 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Jan 30 2017 00:45
@grajsb Sorry it took so long...http://codepen.io/JohnnyBizzel/pen/WRdrKd
Gururaj Birajdar
@grajsb
Jan 30 2017 00:47
I think what you did is correct way of implementing it
to add the searchTerm to callBackUrl in the getJSON call
Gulsvi
@gulsvi
Jan 30 2017 00:54
@avicohen123 Check your developer console - Ctrl+Shift+J and you'll see why it isn't working.
Mixed Content: The page at 'https://codepen.io/acohen102/pen/zNpOKx?editors=1010' was loaded over HTTPS, but requested an insecure script 
'http://api.openweathermap.org/data/2.5/weather?lat=40.912376&lon=-73.123389…d55db2b1&callback=jQuery31005664584122067973_1485737641357&_=1485737641358'. 
This request has been blocked; the content must be served over HTTPS.
Mixed-content error is something everyone seems to be hitting today ;)
avicohen123
@avicohen123
Jan 30 2017 00:58
@SkyCoder01 ah, i see. Why though does @JohnnyBizzel work for me though?
Gulsvi
@gulsvi
Jan 30 2017 01:00
@avicohen123 Did you read that link??
It will answer your question :)
Johnny
@JohnnyBizzel
Jan 30 2017 01:01
@avicohen123 Maybe I did not mix https with http?
avicohen123
@avicohen123
Jan 30 2017 01:01
@SkyCoder01 I posted right before i did. sorry about that
it was http issue
thanks
*https
Johnny
@JohnnyBizzel
Jan 30 2017 01:01
@SkyCoder01 thanks for pointing that out
CamperBot
@camperbot
Jan 30 2017 01:01
johnnybizzel sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 67 | @skycoder01 |http://www.freecodecamp.com/skycoder01
Daniel
@doodleslr
Jan 30 2017 01:18
hey guys i havent done much jquery at all and i've been trying for a day to get my api loaded into codepen and print on console but it wont even bring up anything can anyone tell me if i'm doing it wrong?
$(document).ready(function(){
  $.getJSON('https://gist.githubusercontent.com/doodleslr/10de0b69ea188c85760d130d4de8a990/raw/265220d741d2c501a4c749adc8228779e414b208/SimpsonQuote.js', function (result){
  console.log(result);
  }); 
});
Walter V. Santos
@theunmanifested
Jan 30 2017 01:22
Hello, people. Need some help on the Build a Tribute Page challenge. On the video, Q, Larson shows his CodePen.io app, and he talks about having onlyl used CSS for margin for the body. Does this mean that we should build our tribute page with that rule as well? He does keep repeating that our end result should look very similar to his.
Patrick Tran
@tranpatrick01
Jan 30 2017 01:33
does anyone know python that can help me?
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 01:33
@tranpatrick01 Maybe I can help you
Patrick Tran
@tranpatrick01
Jan 30 2017 01:35
@paulotokimatu thank you
CamperBot
@camperbot
Jan 30 2017 01:35
tranpatrick01 sends brownie points to @paulotokimatu :sparkles: :thumbsup: :sparkles:
:cookie: 369 | @paulotokimatu |http://www.freecodecamp.com/paulotokimatu
Ken Haduch
@khaduch
Jan 30 2017 01:36
@theunmanifested - I think that he says that you can use whatever libraries you need - Bootstrap is one that they give several lessons on, it makes some things easier. If you can do it with only HTML & CSS, then that's great. (I wonder if they changed the intro video for that one? I think it's pretty open-ended what you can use.)
Patrick Tran
@tranpatrick01
Jan 30 2017 01:37
This message was deleted
Walter V. Santos
@theunmanifested
Jan 30 2017 01:37
@khaduch Thanks, man. I think you are right.
CamperBot
@camperbot
Jan 30 2017 01:37
theunmanifested sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2382 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Jan 30 2017 01:37
@theunmanifested - just l ooking at the screenshot of the video, it says "Use whichever libraries or APIs you need. Give it your own personal style".
Patrick Tran
@tranpatrick01
Jan 30 2017 01:39
@paulotokimatu
im doing a challenge on a book of the instruction with if a if a list is in the dictionary print(' thank you for taking the poll'). If value in list is not in dictionary print(please take the poll).
favorite_languages = {
                        'jen':'python',
                        'sarah': 'c',
                        'edward': 'ruby',
                        'phil': 'python'
                        }
friends = [ 'jen', 'long']

for name in favorite_languages:
    if name in friends:
        print(  name + ' ,thank you for taking the poll' + '.')
CamperBot
@camperbot
Jan 30 2017 01:39
tranpatrick01 sends brownie points to @paulotokimatu :sparkles: :thumbsup: :sparkles:
:warning: tranpatrick01 already gave paulotokimatu points
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 01:40
@tranpatrick01 I will send you a personal message
avicohen123
@avicohen123
Jan 30 2017 01:47
I have an issue with my ajax calls and can't seem to get the data to stay with my var's when i use callback
if anyone can let me know what i'm doing wrong that would be great
Hello911
@Hello911
Jan 30 2017 01:49
For Confirm Ending Challenge, what is exactly should the function return? a string? true or false?
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 01:53
@avicohen123 when are you calling the function locationAPICall?
Ken Haduch
@khaduch
Jan 30 2017 01:54
@avicohen123 @avicohen123 - your temperature is in data.main.temp - check your returned data for specific information
Tyler Moeller
@TylerMoeller
Jan 30 2017 01:58
@doodleslr The file you are trying to access is a .js file not .json, and it's an array. You can validate your .json on a site like codebeautify: http://codebeautify.org/jsonviewer
Once you get it validated and formatted correctly, use rawgit to link to your gist: http://rawgit.com/
Rex Smith Jr.
@rsmith731
Jan 30 2017 01:58
hi, i have a question if anyone ca help me about HTML5 video
philiplee15
@philiplee15
Jan 30 2017 02:15
where is everyone at in the course
by the end of this course will we be ready for a job or do we need to study more? also do you guys take a paid bootcamp in addition or start applying?
avicohen123
@avicohen123
Jan 30 2017 02:28
@PAKrishnan
@paulotokimatu I'm not calling it anywhere as I didn't know how to deal with the fact that I had my function inside (after success). @khaduch thank you for noting that but that didn't fix the issue unfortunately. I had just tested something and forgot to change it back.
CamperBot
@camperbot
Jan 30 2017 02:30
avicohen123 sends brownie points to @paulotokimatu and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 370 | @paulotokimatu |http://www.freecodecamp.com/paulotokimatu
:star2: 2383 | @khaduch |http://www.freecodecamp.com/khaduch
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:37
Hello, goodnight there, can someone tell me how to locate the blue botton on the same line of the °F degrees?
http://codepen.io/francodanussi/pen/YNraEo
taltmann42
@taltmann42
Jan 30 2017 02:39
@francodanussi remove display:inline from .temp and add it to .degree
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:40
Worked like a charm. Thank you very much @taltmann42
CamperBot
@camperbot
Jan 30 2017 02:40
francodanussi sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 414 | @taltmann42 |http://www.freecodecamp.com/taltmann42
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:45
Does anyone know if the weatherAPI provides something like icons for sunny, rainy, etc, stats?
Lorrie Pearson
@Lorrie01
Jan 30 2017 02:45
@francodanussi when you click your C button it switches to F
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:46
@Lorrie01 that's intentional}
taltmann42
@taltmann42
Jan 30 2017 02:46
@francodanussi you can look at the results from the api when you just go to the URL with some fake-coordinates
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:47
Yeah, but I mean, I need to generate icons based on the actual weather
I know how to check the result of the API, but I'm not seeing a way to load the icons
Lorrie Pearson
@Lorrie01
Jan 30 2017 02:48
Try this for info to incorporate icons @francodanussi , it may help
https://css-tricks.com/using-weather-data-to-change-your-websites-apperance-through-php-and-css/
taltmann42
@taltmann42
Jan 30 2017 02:48
yep, and when you provide the api with lat and long, and open that url in a new tab, you get the same information as the code, so you'll see if they're providing icons (which i don't think)
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 02:48
@francodanussi You can use font awesome
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:48
@Lorrie01 thanks!
CamperBot
@camperbot
Jan 30 2017 02:48
francodanussi sends brownie points to @lorrie01 :sparkles: :thumbsup: :sparkles:
:cookie: 312 | @lorrie01 |http://www.freecodecamp.com/lorrie01
Lorrie Pearson
@Lorrie01
Jan 30 2017 02:49
@francodanussi you're welcome
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:49
@paulotokimatu what do you mean? there's a font with specific weather icons?
Tyler Moeller
@TylerMoeller
Jan 30 2017 02:49
@francodanussi Yes, the API provides icons. Here are the instructions: https://openweathermap.org/weather-conditions
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:50
@TylerMoeller You're awesome, that's exactly what I needed
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 02:50
@francodanussi I suggested for you to use Font Awesome (http://fontawesome.io), but since, as Tyler said, the API provides icons, it is easierto use that
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:50
@TylerMoeller thank you all of you, and have a good night
CamperBot
@camperbot
Jan 30 2017 02:50
francodanussi sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
Tyler Moeller
@TylerMoeller
Jan 30 2017 02:50
Font Awesome does not have weather icons...yet anyway. Some people use these: https://erikflowers.github.io/weather-icons/
CamperBot
@camperbot
Jan 30 2017 02:51
:star2: 1432 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 02:51
@TylerMoeller Oops, my mistake
Tyler Moeller
@TylerMoeller
Jan 30 2017 02:52
I hope they add them in Fontawesome v5 :)
Franco Javier Danussi
@francodanussi
Jan 30 2017 02:52
@paulio84 thanks, I'm going to read about fontawsome and give it a try
CamperBot
@camperbot
Jan 30 2017 02:52
francodanussi sends brownie points to @paulio84 :sparkles: :thumbsup: :sparkles:
:cookie: 128 | @paulio84 |http://www.freecodecamp.com/paulio84
Lorrie Pearson
@Lorrie01
Jan 30 2017 02:53
@chiuyong put the login on a separate div so that you can adjust it separately and
Chiu Yong
@chiuyong
Jan 30 2017 02:57
@Lorrie01 thanks!
CamperBot
@camperbot
Jan 30 2017 02:57
chiuyong sends brownie points to @lorrie01 :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @lorrie01 |http://www.freecodecamp.com/lorrie01
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 02:58
@chungeric A JSON viewer should help
Lorrie Pearson
@Lorrie01
Jan 30 2017 02:58
You're welcome @chiuyong ..hope it helps, if not, we'll take another look and see what other options their may be.
avicohen123
@avicohen123
Jan 30 2017 03:00
Sorry to ask again but i still have an issue getting my ajax functions to set variables. I just get undefined when i try to access the value. If someone knows a fix or better implementation for this please let me know. Here is my codepen: http://codepen.io/acohen102/pen/zNpOKx?editors=0010
Eric Chung
@chungeric
Jan 30 2017 03:02
@paulotokimatu I have the chrome extension that formats the json data. but just not sure how to access the titles
taltmann42
@taltmann42
Jan 30 2017 03:07

@avicohen123 you're executing the js in this order:

locationAPICall();
weatherAPICall(...

weatherAPICall uses variables you get from locationAPICall. The thing about using APIs is, they're asynchronous, which means, javascript keeps executing its code until results from those requests come.
So before your locationAPICall has even finished, you're trying to call weatherAPICall, which in turn uses the url-variable, which again in turn uses results from locationAPICall, but those results are not yet available.

That's what the callback is for. The API calls that function back, when it got results. So you want to build up the URL inside of the callback from locationAPICall, and then run weatherAPICall from within the locationAPICall callback

Paulo Tokimatu
@paulotokimatu
Jan 30 2017 03:08
@chungeric You want to iterate through the query object, right?
Eric Chung
@chungeric
Jan 30 2017 03:08
@paulotokimatu nevermind, i ended up doing this
response.query.pages[Object.keys(response.query.pages)[0]].title
Paulo Tokimatu
@paulotokimatu
Jan 30 2017 03:10
ok, I was about to suggest to use
for (var property in object) {
    if (object.hasOwnProperty(property)) {
    }
}
Franco Javier Danussi
@francodanussi
Jan 30 2017 03:14
is there an easy way to get the current time in javascript?
taltmann42
@taltmann42
Jan 30 2017 03:14
@francodanussi var date = new Date()
Franco Javier Danussi
@francodanussi
Jan 30 2017 03:14

var date = newDate();
hour = date.getTime();

?

c0d0er
@c0d0er
Jan 30 2017 03:14
@TylerMoeller thanks
CamperBot
@camperbot
Jan 30 2017 03:14
c0d0er sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1433 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Franco Javier Danussi
@francodanussi
Jan 30 2017 03:15
@taltmann42 and then?
taltmann42
@taltmann42
Jan 30 2017 03:15
@francodanussi date.getHours()
Franco Javier Danussi
@francodanussi
Jan 30 2017 03:16
@taltmann42 nice, thanks
CamperBot
@camperbot
Jan 30 2017 03:16
francodanussi sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: francodanussi already gave taltmann42 points
Jasmin Parent
@charlesdarkwind
Jan 30 2017 03:24
Do I need to put the <body> tag in codepen?
Michael Bomholt
@bomholtm
Jan 30 2017 03:29
is there a way to calculate 100vh - height of a div which is changing height?
Ken Haduch
@khaduch
Jan 30 2017 03:44
@charlesdarkwind - no - no <body>, nor <html>, <head>, <style>, <script> - it all comes from CodePen's template
Jasmin Parent
@charlesdarkwind
Jan 30 2017 03:48
@khaduch how can I add an id and other options to it?
I mean attributes
Ken Haduch
@khaduch
Jan 30 2017 03:49
why would you need to add an ID to the body? It is unique (or should be) so you can just add a selector (in jQuery, for example) of $('body') - if you need to use that. What do you want to do to the body that you would need an ID? I'm just curious...
Jasmin Parent
@charlesdarkwind
Jan 30 2017 03:50
@khaduch for bootstrap scrollspy <body data-spy="scroll" data-target="#navbar-example">
Ken Haduch
@khaduch
Jan 30 2017 03:50
@charlesdarkwind - just use the CSS body { background-image: etc. }; to select and add values to it.
hmmmm - I haven't used that. So maybe you have an issue there? Maybe there is a way to solve that...I have seen people using that, and just adding an extra <body> element - it makes illegal HTML coming out of CodePen, but generally browsers can handle that.
Jasmin Parent
@charlesdarkwind
Jan 30 2017 03:54
I added the extra <body> and nothing broke but im not sure if thats the official way to do so if we want to add these bootstrap attributes
@khaduch
Ken Haduch
@khaduch
Jan 30 2017 03:56
@charlesdarkwind - as I said - it seems to work, in general. The browsers tolerate a lot of erroneous HTML, and it's too bad that CodePen doesn't give you a way to override the template usage in some way. I guess that another way to do it would be to add those attibutes with some jQuery or JavaScript code - circumnavigating the CodePen template. There are ways to add things to the head in the head config panel - too bad they don't have the body included in there?
Jasmin Parent
@charlesdarkwind
Jan 30 2017 04:03
@khaduch yea thats odd, I need to feature an highlight in the nav that changes depending on the scroll position on the page for the portfolio challenge but the example portfolio is not using scrollspy, they have body tags thought
Ken Haduch
@khaduch
Jan 30 2017 04:04
@charlesdarkwind - googleing for some info, I found this link where the author is using javascript code to add a class the the <body> At least that looks like a way to make it work in CodePen without violating the HTML spec - although there isn't an explanation given within the CodePen project?
Ken Haduch
@khaduch
Jan 30 2017 04:14
@charlesdarkwind - not to belabor the point, but this CodePen tutorial shows how to add scrollspy and you are not using the <body> element but a different element. I cannot say that I fully understand it, but there is an example in the tutorial. Maybe it will help?
c0d0er
@c0d0er
Jan 30 2017 04:15
does anybody know how to get event.target value with redux?
Ken Haduch
@khaduch
Jan 30 2017 04:23
@c0d0er - I barely know anything about that redux, but I started going through some lessons. Do you have to bind this to an element somehow to make that work?
c0d0er
@c0d0er
Jan 30 2017 04:23
@khaduch no
Ken Haduch
@khaduch
Jan 30 2017 04:23
@c0d0er - okay, then you know more than I do...
Gururaj Birajdar
@grajsb
Jan 30 2017 04:28
Hello
I would like some feedback on my wikipedia viewer challenge
Any suggestions for improving it?
Charles Williams
@cfunkles
Jan 30 2017 04:33
Hello
I don't understand the difference between the order of these selectors
.nav li vs li.nav?
each way gives different results and I've seen them used both ways in many examples
Coy Sanders
@coymeetsworld
Jan 30 2017 04:42
first is a selector for list elements nested inside an element with class nav
second is list element with class nav
Charles Williams
@cfunkles
Jan 30 2017 04:45
@coymeetsworld great! i get it now
Coy Sanders
@coymeetsworld
Jan 30 2017 04:45
right on
h1tag
@h1tag
Jan 30 2017 04:46
Hey, what's the hex code for the default font color in webpages?
Steven Failla
@Stevo99
Jan 30 2017 04:47
can someone take a look at this and tell me why theres a gap between my nav and my background. I want the backround image to stop exactly at the nav bar so theres no gap.
its a really simple pen
h1tag
@h1tag
Jan 30 2017 04:51
@Stevo99 do you want the whole page background to be grey?
Steven Failla
@Stevo99
Jan 30 2017 04:53
yes
h1tag
@h1tag
Jan 30 2017 04:55
@Stevo99 put background-color: grey; inside the body selector in the css section
Steven Failla
@Stevo99
Jan 30 2017 05:01
yea i know how to do that. but how come, if i was gonna break it into pages, my background color for the first page doesnt align right under the nav
h1tag
@h1tag
Jan 30 2017 05:06
I think this is because this the size of the div, so the background color just scales to the size of the div
deepakSpatil
@deepakSpatil
Jan 30 2017 05:41
any idea wat are the requirements to learn IONIC framework....any specific languages required ?
Steven Failla
@Stevo99
Jan 30 2017 06:23
@fortMaximus thanks makes sense
CamperBot
@camperbot
Jan 30 2017 06:23
stevo99 sends brownie points to @fortmaximus :sparkles: :thumbsup: :sparkles:
:cookie: 267 | @fortmaximus |http://www.freecodecamp.com/fortmaximus
Chinmaya B
@sharang108
Jan 30 2017 06:32
toggle button not working help http://codepen.io/sharang108/pen/OWOByQ
anybody?
h1tag
@h1tag
Jan 30 2017 06:39
@sharang108 try asking in HelpJavaScript chat, it's more active right now
alonl6
@alonl6
Jan 30 2017 06:41
Hey. Do you think I can upload projects with my github instead of codepen? Will it be alright? I don't really like codepen.. I prefer do the work on my personal development environment and upload it to github
Chinmaya B
@sharang108
Jan 30 2017 06:42
@fortMaximus Okay
h1tag
@h1tag
Jan 30 2017 06:44
@alonl6 I don't think so. The 1st requirement is to use codepen. Try asking on the "Help" chat group, maybe there's some workaround
tptynlr
@tptynlr
Jan 30 2017 06:45
@alonl6 write ur code in computer and once u finish the project copy and paste that code in codepen
Chinmaya B
@sharang108
Jan 30 2017 07:00
@fortMaximus No help there
h1tag
@h1tag
Jan 30 2017 07:05
@sharang108 did they try to help you there or nobody responded at all?
c0d0er
@c0d0er
Jan 30 2017 07:17
does anybody know why my td cells border is weird? it should be a whole table, but now it is all separate, what is the reason? http://codepen.io/c0d0er/pen/dOxxay/
kirbyedy
@kirbyedy
Jan 30 2017 07:25
@c0d0er
table {
  border-spacing: 0;
}
c0d0er
@c0d0er
Jan 30 2017 07:27
@kirbyedy thanks!
CamperBot
@camperbot
Jan 30 2017 07:27
c0d0er sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1716 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
jpchaufan
@jpchaufan
Jan 30 2017 07:27
hey anyone, to use react locally on my own computer, do i have to set up node?
kirbyedy
@kirbyedy
Jan 30 2017 07:31
I guess there are different ways
I found this one
alonl6
@alonl6
Jan 30 2017 07:33
Hey. Can you see the background img and the header img? http://codepen.io/alonl6/full/ygPWNZ/ just want to be sure its working fine
for some reason codepen wont load the imgs
kirbyedy
@kirbyedy
Jan 30 2017 07:36
nope
@alonl6 even if I copy/paste your picture url in the browser it does not show, I think that has to do with google image host
either the image is not publicly shared or the link is wrong
alonl6
@alonl6
Jan 30 2017 07:38
any better way for hosting images for free?
I see its possible with codepen pro
kirbyedy
@kirbyedy
Jan 30 2017 07:42
I use github
Eric Chung
@chungeric
Jan 30 2017 07:45
Hi guys, I think i've finished my wikipedia viewer. Any feedback?? https://codepen.io/chungeric/full/dNZEaZ/
h1tag
@h1tag
Jan 30 2017 07:52
@chungeric good job
alonl6
@alonl6
Jan 30 2017 07:56
@kirbyedy hey can you check again if you see the images? Thank you
CamperBot
@camperbot
Jan 30 2017 07:56
alonl6 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1717 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
h1tag
@h1tag
Jan 30 2017 07:57
@alonl6 it's working fine now. Good job
alonl6
@alonl6
Jan 30 2017 07:57
Great. Thanks
h1tag
@h1tag
Jan 30 2017 08:08
@alonl6 do u have past experience in design?
alonl6
@alonl6
Jan 30 2017 08:08
yes
h1tag
@h1tag
Jan 30 2017 08:09
@alonl6 graphic or web designer?
alonl6
@alonl6
Jan 30 2017 08:13
Web. But I did some print as well
h1tag
@h1tag
Jan 30 2017 08:14
where did you learn to design like this? @alonl6
alonl6
@alonl6
Jan 30 2017 08:19
I took lessons and learned the softwares but as for the design itself.. I don't know its something that I had.
devpaaji
@devpaaji
Jan 30 2017 08:54
@alonl6
can you help correct the css part
Or Halimi
@orhalimi
Jan 30 2017 08:56
Hey guys, anyone here can help me with something on js?
devpaaji
@devpaaji
Jan 30 2017 09:01
@orhalimi go to Help JS chat room
most apt and really strong support
Or Halimi
@orhalimi
Jan 30 2017 09:20
th
x
Jack Lyons
@JackEdwardLyons
Jan 30 2017 09:25
hey guys im working on my simon game and wondering if anyone could help?
its just to do with pushing through a random number for the tile index, im like 90 percent there...
Muhammad Farhan Bin Brohan
@FarhanBrohan
Jan 30 2017 09:34
I need some clarification
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
</form>
What does that actually do?
Megan
@megan32
Jan 30 2017 09:37
sweet! @orhalimi -totally looking at the right thing (true/false start) too many stinkin' equals signs...
@orhalimi thank you!
CamperBot
@camperbot
Jan 30 2017 09:37
megan32 sends brownie points to @orhalimi :sparkles: :thumbsup: :sparkles:
:cookie: 112 | @orhalimi |http://www.freecodecamp.com/orhalimi
Or Halimi
@orhalimi
Jan 30 2017 09:38
np ^^ got better by debugging my not-working code --"
Megan
@megan32
Jan 30 2017 09:39
I stared at that for so long, kills me every time haha
Or Halimi
@orhalimi
Jan 30 2017 09:40
When I realised I cant debug on codepen I post there only the finish product ><
Megan
@megan32
Jan 30 2017 09:41
Yeah, I've moved to Brackets and Atom (LOVE LOVE LOVE) and use github to debug (thanks to the fabulous people here for pointing me in that direction!)
alonl6
@alonl6
Jan 30 2017 09:44
@devpaaji Hey. I can try. What do you need?
devpaaji
@devpaaji
Jan 30 2017 09:50
check the msg @alonl6 i sent pm
KOOTSTHEHOOTS
@KOOTSTHEHOOTS
Jan 30 2017 10:28
guys what is the user story i have to fulfill for the front end project
oops nvm got it haha
xemexpress
@xemexpress
Jan 30 2017 11:01
hi guys, I used bootstrap to style a button, but I specifically don't want the hover effect. How can I override that?
I tried !important in CSS, but failed to do the job
something like
color: white !important;
Can somebody help? Thanks!
xemexpress
@xemexpress
Jan 30 2017 11:11
Oh! Problem solved. I put like this:
button, button:hover {
  color: white !important;
}
Tim Handy
@TimHandy
Jan 30 2017 12:10
Hi, I have a series of 100 divs that I am rendering to page. I would like to use css to force them to wrap into rows of 10. Is this possible?
Simon Cordova
@gbsimon87
Jan 30 2017 12:10
Good afternoon everyone
Anybody have experience with local storage objects?
Tim Handy
@TimHandy
Jan 30 2017 12:10
@gbsimon87 A little bit, yes
Simon Cordova
@gbsimon87
Jan 30 2017 12:12
@TimHandy cheers for answering...
Basically, I need to setup a local storage for a site.
In this storage I need to create an object variable that'll take the username's and store it in the object.
user's name**
Tim Handy
@TimHandy
Jan 30 2017 12:13
have you used localStorage before? i.e get the idea of how it works?
Simon Cordova
@gbsimon87
Jan 30 2017 12:13
I have indeed, but not in a dynamic sense.

For example, I signed in to the site and saw that I can get my username using this code...

$(".thirdwidth.f-medium.align-center").text().slice(14, -1);

Now I don't know how to incorporate that in the object itself

Tim Handy
@TimHandy
Jan 30 2017 12:21
@gbsimon87 Not sure if this will help, but this is how I programatically worked with localStorage: https://github.com/TimHandy/recipe-box/blob/master/src/App.jsx lines 24 and 37 are my retrieve and save functions.
Simon Cordova
@gbsimon87
Jan 30 2017 12:25
@TimHandy thank you, I'll certainly take a look into it
CamperBot
@camperbot
Jan 30 2017 12:25
gbsimon87 sends brownie points to @timhandy :sparkles: :thumbsup: :sparkles:
:cookie: 341 | @timhandy |http://www.freecodecamp.com/timhandy
Tim Handy
@TimHandy
Jan 30 2017 12:29
@gbsimon87 you're welcome, hope it helps?!
Chinmaya B
@sharang108
Jan 30 2017 12:38
@fortMaximus No body bothered to address my issue
alpox
@alpox
Jan 30 2017 12:41
@sharang108 What was the issue?
It was probably noone online who could answer that time
Chinmaya B
@sharang108
Jan 30 2017 12:42
The toogle f to celcius is not working
alpox
@alpox
Jan 30 2017 12:42
@sharang108 Ah i see your problem
Chinmaya B
@sharang108
Jan 30 2017 12:42
@alpox
alpox
@alpox
Jan 30 2017 12:43
You create click events on page load but when you click the button, you replace the html.
Means:
  1. One click event has no target at the beginning.
  2. No click event gets attached to the newly created html.
So you maybe just want to replace the inner html of the one button instead of replacing the whole button
Chinmaya B
@sharang108
Jan 30 2017 12:44
You mean i need separate buttons?
alpox
@alpox
Jan 30 2017 12:44
No just one button and exchange its content on click on it
So there is also only one click event handler
Chinmaya B
@sharang108
Jan 30 2017 12:46
Well i am a hardnut can you demonstrate? I am thinking of using if statement with the temp data feild
alpox
@alpox
Jan 30 2017 12:46
@sharang108 You can use a boolean as a state variable and then use an if as you say
Chinmaya B
@sharang108
Jan 30 2017 12:48
Also its not just about the content of a button i have to change the temp paragraph. @alpox
alpox
@alpox
Jan 30 2017 12:49
@sharang108 Outline: http://codepen.io/alpox/pen/xgpLpB
Do you see what i'm doing there? :-)
You use just one event handler on the button and then do all the stuff in there
But do not replace the whole button - instead replace its content.
The temp paragraph you can handle in there too
Chinmaya B
@sharang108
Jan 30 2017 12:59
@alpox thanks
CamperBot
@camperbot
Jan 30 2017 12:59
sharang108 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 755 | @alpox |http://www.freecodecamp.com/alpox
Husam
@7usam
Jan 30 2017 13:04
Hello guys
is tehere a room for python in Gitter ?
cause I couldn't find anything in the search
alpox
@alpox
Jan 30 2017 13:11
@7usam Sry for former link. That was bit mistaken regarding the language :-)
I see that the python community mainly talks through IRC: https://www.python.org/community/irc/
Husam
@7usam
Jan 30 2017 13:12
@alpox thanks a lot boss
CamperBot
@camperbot
Jan 30 2017 13:12
7usam sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 756 | @alpox |http://www.freecodecamp.com/alpox
Icah Banton
@remdata
Jan 30 2017 13:20
Hello. I need a little help with the wikiSearch challenge. I am trying to get the api to work. Please ignore the extra clutter (working in progress). When I click on my random search option and try the api call it seems to get nothing. Someone please check the api I am using and let me know what I am doing wrong. http://codepen.io/ibanton/pen/GrOBzR
alpox
@alpox
Jan 30 2017 13:23
@remdata I thought for the random search there is a simple link which you can set to an a element
Icah Banton
@remdata
Jan 30 2017 13:25
@alpox . What is that link?
alpox
@alpox
Jan 30 2017 13:25
@remdata https://en.wikipedia.org/wiki/Special:Random
Brings you to a random page
@remdata Ignoring that, you don't get a response because of the CORS issue. You could come around with adding &callback=? to your query string which makes your request a JSONP request
Icah Banton
@remdata
Jan 30 2017 13:30
@alpox . what is the CORS issue?
alpox
@alpox
Jan 30 2017 13:33
@remdata Cross Origin Resource Sharing. For security, the browser does not allow to access content from another domain unless the other server explicitely allow this through adding a specific header named Access-Control-Allow-Origin.
So you won't be able to access it with normal requests.
Therefore you can either proxy the request through something like crossorigin.me or issue a JSONP request (Which is obviously quite insecure but works)
Icah Banton
@remdata
Jan 30 2017 13:35
@alpox . Got it. thanks.
CamperBot
@camperbot
Jan 30 2017 13:35
remdata sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 757 | @alpox |http://www.freecodecamp.com/alpox
Chinmaya B
@sharang108
Jan 30 2017 13:59
@alpox Your code is not working the OF button is not respoinding
responding/working
alpox
@alpox
Jan 30 2017 14:01
@sharang108 Working now. Sorry, i played around a bit and it saved something it shouldn't have :-)
Chinmaya B
@sharang108
Jan 30 2017 14:01
@alpox Yeah Its working now
devpaaji
@devpaaji
Jan 30 2017 14:08
@alpox
how do I create a underline in header
something like thsi
alpox
@alpox
Jan 30 2017 14:15
@devpaaji underline is in css text-decoration: underline
If you want it only on some parts of a text like in the example you can do <h1><span style="text-decoration: underline">Build So</span>mething</h1>
If you want it to be a specific width you have to go without the text-decoration like:
<h1><span style="text-decoration: none; border-bottom: 1px solid black;">Build So</span>mething</h1>
PipsChips
@PipsChips
Jan 30 2017 14:24
Hi! Could someone pls check my JS part of code for typos and/or mistakes. I got my code working, but I tried to make it more sophisticated, then I got stuck :).
http://codepen.io/PipsChips/pen/pRWRKd
It doesn't even want to load....
taltmann42
@taltmann42
Jan 30 2017 14:25
@PipsChips there is a red exclamation mark in the JS-panel. Click on it and it shows you where the error is
PipsChips
@PipsChips
Jan 30 2017 14:36
@taltmann42
Thnx! I managed to get it loaded. But now... it doesn't work (generate quotes)...
http://codepen.io/PipsChips/pen/pRWRKd
CamperBot
@camperbot
Jan 30 2017 14:36
pipschips sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 417 | @taltmann42 |http://www.freecodecamp.com/taltmann42
taltmann42
@taltmann42
Jan 30 2017 14:40
@PipsChips did it work before?
PipsChips
@PipsChips
Jan 30 2017 14:43
Yes, then I had problems with cache. It generated only the first quote.
I tried with $.ajaxSetup setting cache to false
but code still didn't work properly... so I started again from the beginning... and now I'm here :)
taltmann42
@taltmann42
Jan 30 2017 14:46
@PipsChips well you have no clickhandlers anywhere, so the function getQuote is never called
PipsChips
@PipsChips
Jan 30 2017 15:01
@taltmann42
I managed to do smth
http://codepen.io/PipsChips/pen/rjppaJ
It still does not work properly. Now I'm gonna try to fix it.
taltmann42
@taltmann42
Jan 30 2017 15:02
@PipsChips $("#tweet_anchor").attr("href", 'https://twitter.com/intent/tweet?text=' + json.quoteText + " — " + json.quoteAuthor); This is not in the callback, so it doesn't have access to json
PipsChips
@PipsChips
Jan 30 2017 15:02
All the time I'm having trouble putting all the functions in right order...
Melissa Lynne DuCasse
@MelissaLynneD81
Jan 30 2017 15:09
I don't understand how he did all his styling in bootstrap...how did he customize fonts in bootstrap and not use css part.
i'm doing the tribute page.
PipsChips
@PipsChips
Jan 30 2017 15:10
@taltmann42
I solved that problem now. Why does my page generate the quote - immediately as it loads (before I even click on a provided button; which is outside my 'getQuote' function)...?
http://codepen.io/PipsChips/pen/rjppaJ
taltmann42
@taltmann42
Jan 30 2017 15:11
@PipsChips because you call it?
@PipsChips last line in your JS
PipsChips
@PipsChips
Jan 30 2017 15:13
@taltmann42
Yeah, but I call it only on 'click'....
... on button click*
taltmann42
@taltmann42
Jan 30 2017 15:15
@PipsChips no you don't....
@PipsChips oh you do now.. let me see
@PipsChips it is in the last line
@PipsChips if you provide an event listener with a function to call, you don't write thisIsMyFunction() but only thisIsMyFunction
PipsChips
@PipsChips
Jan 30 2017 15:18
@taltmann42
Wohoo. Thank you!
CamperBot
@camperbot
Jan 30 2017 15:18
pipschips sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: pipschips already gave taltmann42 points
PipsChips
@PipsChips
Jan 30 2017 15:19
Everything works properly now!
http://codepen.io/PipsChips/pen/rjppaJ
taltmann42
@taltmann42
Jan 30 2017 15:19
:thumbsup:
Chinmaya B
@sharang108
Jan 30 2017 15:52
How to use console.log() with code pen to debug Jscript code?http://codepen.io/sharang108/pen/JEMOmv?editors=1010
Tyler Moeller
@TylerMoeller
Jan 30 2017 15:58
@sharang108 you are using it correctly in your codepen, but that code runs before you type anything in the search box.
$('#search').on('click', function() {
  var x = $("#query").val();
  console.log(x);
  $("#main").html("<p>"+x+"</p>");  
});
^^ Then update your font colors in your CSS so you can see the text in your HTML
Chinmaya B
@sharang108
Jan 30 2017 15:59
@TylerMoeller Oh okay totally forgot about the flow..
But how to detect console outpout?
put?
Tyler Moeller
@TylerMoeller
Jan 30 2017 16:02
@sharang108 What do you mean by detecting the output?
inspect?
Philipp Scholz
@philipp32
Jan 30 2017 16:02

Hey :) This is my code:

output.html(jsonData[1][i] + " - " + jsonData[2][i]);

How can I include html in that line of code. For example, I'd like a break between jsonData[1][i] & jsonData[2][i]. I've tried + <br> + but that didn't work. Also on SOF I couldn't find a proper solution to my problem. It would also be nice to give the jsonData[1][i] the color of blue. How would I go about that?

Chinmaya B
@sharang108
Jan 30 2017 16:03
Yeah because I run it on Firefox and Inspect element is horrible
@TylerMoeller
Tyler Moeller
@TylerMoeller
Jan 30 2017 16:03
blob
Click the Console button ^^
Chinmaya B
@sharang108
Jan 30 2017 16:03
@TylerMoeller Very well thanks
CamperBot
@camperbot
Jan 30 2017 16:03
sharang108 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1434 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Philipp Scholz
@philipp32
Jan 30 2017 16:04

Hey :) This is my code:

output.html(jsonData[1][i] + " - " + jsonData[2][i]);

How can I include html in that line of code. It would be nice to give the jsonData[1][i] the color of blue and a different font size. How would I go about that?

Tyler Moeller
@TylerMoeller
Jan 30 2017 16:04
But, Codepen's console won't show you many errors. It is best to use your browser's console... @sharang108
Chinmaya B
@sharang108
Jan 30 2017 16:04
@TylerMoeller How to use that?
Tyler Moeller
@TylerMoeller
Jan 30 2017 16:04
@sharang108 I use Chrome, but I think it's the same in Firefox: Ctrl+Shift+j
Chinmaya B
@sharang108
Jan 30 2017 16:06
@TylerMoeller Yeah its the same
Tyler Moeller
@TylerMoeller
Jan 30 2017 16:06
@sharang108 Firefox console will give you errors - codepen's will not.
Like API errors, cross-origin errrors, etc
taltmann42
@taltmann42
Jan 30 2017 16:07
@philipp32 it should work it you add something like <div class="yourspecialclassname"> infront of your parameter and </div> afterwards. Then you can style that element in CSS with .yourspecialclassname
Philipp Scholz
@philipp32
Jan 30 2017 16:07
output.html("<h1>" + jsonData[1][i]+ "</h1>" + "<br>" + jsonData[2][i]);
This works for making a heading but not how to change the color of the font. I've tried inline CSS but that didn't do the trick.
@taltmann42 I put both of it in the same div.
Chinmaya B
@sharang108
Jan 30 2017 16:08
@TylerMoeller Yeah I noticed that
Muhammad Hasham
@MohammadHasham
Jan 30 2017 16:08

can anyone help me to understand this code

var data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck' ];
  var transport = data.reduce(function(obj,item){
   if (!obj[item]) obj[item]=0;
   obj[item]++;
   return obj;

  },{});
console.log(transport);

it is to count the repetition of each element.

can anyone help me to understand this code

var data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck' ];
  var transport = data.reduce(function(obj,item){
   if (!obj[item]) obj[item]=0;
   obj[item]++;
   return obj;

  },{});
console.log(transport);

it is to count the repetition of each element.

@TylerMoeller
taltmann42
@taltmann42
Jan 30 2017 16:08
@philipp32 was that a question or a statement?
Philipp Scholz
@philipp32
Jan 30 2017 16:09
@taltmann42 That was a question. How can I change the color of jsonData[1][i] there?
taltmann42
@taltmann42
Jan 30 2017 16:09
@philipp32 okay with your example, you then have to declare styles for h1
Philipp Scholz
@philipp32
Jan 30 2017 16:11

@taltmann42 I've tried this:

output.html("<h1 style="color:blue>" + jsonData[1][i]+ "</h1>" + "<br>" + jsonData[2][i]);

That didn't work.

taltmann42
@taltmann42
Jan 30 2017 16:11
@philipp32 if you want that specific color only for that specific h1, you can classify it with <h1 class="specialheading"> and style it in CSS with h1.specialheading
Lukáš Hanák
@lukashanak
Jan 30 2017 16:11
Hey guys, can help me someone please ? I need to "Build a Tribute Page"... But in the video man shows he use boostrap only... Can I edit css a little more, or I can use just a boostrap, no CSS edit ? (sorry for english, I learn english effectively 1,5 year only )
taltmann42
@taltmann42
Jan 30 2017 16:11
using inline-styles is a really bad-practice, you should declare all styles in CSS
Tyler Moeller
@TylerMoeller
Jan 30 2017 16:11
@MohammadHasham Don't tag me and then post your question in multiple chat rooms... makes people do duplicate work to give you the same answer ;)
taltmann42
@taltmann42
Jan 30 2017 16:12
your inline-style doesn't work, because you are interrupting the string with the " in style="
Philipp Scholz
@philipp32
Jan 30 2017 16:12
@taltmann42 That's what I just tried. Didn't work. I generally like to avoid that as well.
@lukashanak You can use whatever you like. :)
There are no restrictions.
taltmann42
@taltmann42
Jan 30 2017 16:12
@philipp32 can you post a link to the codepen (if it is one) with your approach?
Chinmaya B
@sharang108
Jan 30 2017 16:13
@lukashanak Click on the Code pen thing and you will notice a editor start coding html css in it
taltmann42
@taltmann42
Jan 30 2017 16:13
@philipp32 okay I think you made the same mistake with the class that's why it didn't work
Philipp Scholz
@philipp32
Jan 30 2017 16:13
@taltmann42 Had to leave out the "" for the class. Now it works. Thanks :)
CamperBot
@camperbot
Jan 30 2017 16:13
:cookie: 422 | @taltmann42 |http://www.freecodecamp.com/taltmann42
philipp32 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
Chinmaya B
@sharang108
Jan 30 2017 16:13
and try to emulate the example Tribute page shown @lukashanak
taltmann42
@taltmann42
Jan 30 2017 16:14
@philipp32 when you start a string with " and you want to use " inside that string, either use ' or escape it with \"
leaving that completely out isn't that good either ;) that would break as soon as you want to add more than 1 class to an element
Lukáš Hanák
@lukashanak
Jan 30 2017 16:14
@philipp32 t @sharang108 Ok thank you, was helpfull :D
CamperBot
@camperbot
Jan 30 2017 16:14
lukashanak sends brownie points to @philipp32 and @sharang108 :sparkles: :thumbsup: :sparkles:
:cookie: 272 | @philipp32 |http://www.freecodecamp.com/philipp32
Philipp Scholz
@philipp32
Jan 30 2017 16:14
@taltmann42 thank you.
CamperBot
@camperbot
Jan 30 2017 16:14
philipp32 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: philipp32 already gave taltmann42 points
:cookie: 256 | @sharang108 |http://www.freecodecamp.com/sharang108
Philipp Scholz
@philipp32
Jan 30 2017 16:18
@taltmann42 Just one small question left. How can i add an anchor element to an existing div element with JavaScript?
taltmann42
@taltmann42
Jan 30 2017 16:19
@philipp32 select the existing div, and use the append function: http://api.jquery.com/append/
@philipp32 or, if the anchor tag is the only thing inside that div, you can use $("selector").html("<a href.....etc")
Icah Banton
@remdata
Jan 30 2017 16:37
hello. As someone fairly new to Javascript. What is the simplest way to add the following HTML to a page/docment using Javascript? <div id="myID" class="myClass">My text</div>
taltmann42
@taltmann42
Jan 30 2017 16:38
@remdata are you using jQuery or plain javascript?
Where do you want the element to be? Just at the bottom of the page, or inside a specific element?
Philipp Scholz
@philipp32
Jan 30 2017 16:40
@taltmann42 thank you. I've seen this function often in other pens. Now I understand. Thank very much. :-*
CamperBot
@camperbot
Jan 30 2017 16:40
:warning: philipp32 already gave taltmann42 points
philipp32 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
Icah Banton
@remdata
Jan 30 2017 16:40
@taltmann42 plain javascript. inside a specified element.
taltmann42
@taltmann42
Jan 30 2017 16:40
@philipp32 no problem, if you have any more questions, go for it
@remdata okay, then you need to select that element first. For that, you can use document.querySelector (https://developer.mozilla.org/de/docs/Web/API/Document/querySelector)
When you have that element selected, and assigned to a variable (in this example var element) you can then use this:
element.innerHTML = '<div id="myID" class="myClass">My text</div>';
Icah Banton
@remdata
Jan 30 2017 16:42
@taltmann42 . I guess I would also like to know how to do it using jQuery.
taltmann42
@taltmann42
Jan 30 2017 16:42
@remdata pretty similar:
instead of document.querySelector("yourselector") it is jQuery("yourselector")
and setting the HTML: instead of element.innerHTML = "..." it is element.html("...")
Icah Banton
@remdata
Jan 30 2017 16:47
@taltmann42 . Thanks.
CamperBot
@camperbot
Jan 30 2017 16:47
remdata sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 425 | @taltmann42 |http://www.freecodecamp.com/taltmann42
Japneet Singh
@japsuchiha
Jan 30 2017 16:47
http://codepen.io/designercoder123/pen/GrOezK?editors=1111 i am not getting my city name in the console
Tariyel Hamidov
@tariellaelius
Jan 30 2017 16:57
@designercoder123 Strange, because it does show my city
Japneet Singh
@japsuchiha
Jan 30 2017 16:59
@tariellaelius i just got to know it doesn't work with chrome
Philipp Scholz
@philipp32
Jan 30 2017 17:10

@taltmann42 Are you still there? A question popped up regarding the append function.

$("#article"+i ).append("<a href = jsonData[3][i]></a>");

This is my line of code but it doesn't work, sadly. What did I do wrong?

taltmann42
@taltmann42
Jan 30 2017 17:18
@philipp32 there is nothing to show inside the a tag
Philipp Scholz
@philipp32
Jan 30 2017 17:19
@taltmann42 Well, the whole div is supposed to become the anchortag.
taltmann42
@taltmann42
Jan 30 2017 17:19
@philipp32 it's also a convention not to have spaces between attributes and their value, and to add quotes (single or double) => href='"+jsonDa...+"'
@philipp32 so you want to replace the div with an a-tag?
or, do you want the whole "#article"+i div to be clickable?
Philipp Scholz
@philipp32
Jan 30 2017 17:20
No, I want to add the anchor tag to the div.
Yes.
taltmann42
@taltmann42
Jan 30 2017 17:20
okay, the anchor tag only links elements which are inside of it, but luckily there is another jquery method for that one sec
@philipp32
Philipp Scholz
@philipp32
Jan 30 2017 17:23
@taltmann42 That works. Now I can click the divs.
taltmann42
@taltmann42
Jan 30 2017 17:23
:thumbsup:
Philipp Scholz
@philipp32
Jan 30 2017 17:23
Now the console is telling me that the link PROVIDED by the wikipedia API don't have a cross origin whatever. -.-
@taltmann42 thanks for now. :)
CamperBot
@camperbot
Jan 30 2017 17:24
philipp32 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 426 | @taltmann42 |http://www.freecodecamp.com/taltmann42
taltmann42
@taltmann42
Jan 30 2017 17:24
@philipp32 can you provide the codepen link again?
taltmann42
@taltmann42
Jan 30 2017 17:25
works just fine?
the cross-origin thingy is just caused by the fonts
when you open the pen in https (https://codepen.io/philipp32/pen/bgaLMm?editors=1010) there is no error at all in the console
Philipp Scholz
@philipp32
Jan 30 2017 17:26
OH. That's something I can fix. While you are at it. Why is the <i> element in my HTML not showing? I've tried several methods and nothing happened.
I've also tried adding the &origin=*
And I still get the 404 - Page not Found message.
Fixed the font thing. Same results.
taltmann42
@taltmann42
Jan 30 2017 17:30
@philipp32 for the icon: <i class="fa fa-times" id ="delete"></i> may be something you're looking for
Ognyan Malinov
@omalinov1994
Jan 30 2017 17:30

Hey guys, I am building a tribute page and I run into a problem.
I want my picture to be this size and have the thumbnail text on the bottom of it.
http://imgur.com/a/MKZDw

When I add the div thumbnail the image gets huge.
http://imgur.com/a/yaH6t

How can I make it so that the thumbnail is the size of the image?

I am using this as well:
.main-image{
height: 500px;
width: auto;

  margin:0 auto;
  margin-top:15px;

}

taltmann42
@taltmann42
Jan 30 2017 17:31
@philipp32 look at the resulting a-tag: <a href="jsonData[3][i]+">
Philipp Scholz
@philipp32
Jan 30 2017 17:31
thank you.
taltmann42
@taltmann42
Jan 30 2017 17:32
@philipp32 no wonder that page isn't found ;)
Philipp Scholz
@philipp32
Jan 30 2017 17:32
Fixed that already my friend. Doesn't work.
@omalinov1994 what do you mean by thumbnail?
the white thing behind it?
taltmann42
@taltmann42
Jan 30 2017 17:33
no it's still the same
See for yourself
taltmann42
@taltmann42
Jan 30 2017 17:34
did
Philipp Scholz
@philipp32
Jan 30 2017 17:34
The thing is that I want this to work in http as well.
taltmann42
@taltmann42
Jan 30 2017 17:34
<a href="jsonData[3][i]">
Philipp Scholz
@philipp32
Jan 30 2017 17:34
is that wrong?
taltmann42
@taltmann42
Jan 30 2017 17:34
well, this tries to go to the website "jsonData[3][i]"
Philipp Scholz
@philipp32
Jan 30 2017 17:35
I looked at the data in console.log and it was correct.
taltmann42
@taltmann42
Jan 30 2017 17:35
you included jsonData[3][i] as a string, not as the data behind it
Philipp Scholz
@philipp32
Jan 30 2017 17:35
The links provided were accuratletly.
OH!
So how do I change that?
taltmann42
@taltmann42
Jan 30 2017 17:35
yes behind the data, but instead linking the data behind jsonData you just printed that as text
@philipp32 in the same way you built the h1
Ognyan Malinov
@omalinov1994
Jan 30 2017 17:36
@philipp32 Yes I think that the class thumbnail overrides my custom class .main-image and the size changes. I Fixed it by addig style="max-width:40%" but now my image is left alligned. Anyone have an idea how I can make an image go in the middle of the page?
taltmann42
@taltmann42
Jan 30 2017 17:37
@omalinov1994 have you tried adding margin: 0 auto to the containing div?
Philipp Scholz
@philipp32
Jan 30 2017 17:37
@taltmann42 May I give the warmest hug to you, dear friend.
@taltmann42 Wanted to suggest the same.
Muzaffar Hussain
@Muzaffarhssn5
Jan 30 2017 17:38

Hi can anyone help me this... I am trying to change the background colors of two elements when a certain button is clicked.. but it doesnt seem to be working...

$(document).ready(function() {

function clickFunc() {
var colorArr = ['#16a085', '#27ae60', '#2c3e50', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', "#472E32", "#BDBB99", "#77B1A9", "#73A857"];
var colorNum = Math.floor(Math.random() * colorArr.length);
$('.surround-quote','.buttons').animate({backgroundColor: colorArr[colorNum]},1000);
}

$('#new-quote').on('click', clickFunc);

});

Philipp Scholz
@philipp32
Jan 30 2017 17:38
@omalinov1994 text-align: center; is also nice.
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
Ognyan Malinov
@omalinov1994
Jan 30 2017 17:39
@philipp32 I would like to allign an image, will text-allign work?
Philipp Scholz
@philipp32
Jan 30 2017 17:39
yes
taltmann42
@taltmann42
Jan 30 2017 17:39
@omalinov1994 an image is affected by the parents text-align:center
Ognyan Malinov
@omalinov1994
Jan 30 2017 17:39
@taltmann42 Yes in a custom CSS class.
Philipp Scholz
@philipp32
Jan 30 2017 17:39
text-align: center can be applied to a multitude of objects#
Ognyan Malinov
@omalinov1994
Jan 30 2017 17:39
Thanks guys :)
Philipp Scholz
@philipp32
Jan 30 2017 17:40
I wish you the best of luck. Thanks again @taltmann42.
CamperBot
@camperbot
Jan 30 2017 17:40
philipp32 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: philipp32 already gave taltmann42 points
Philipp Scholz
@philipp32
Jan 30 2017 17:40
Have a nice day.
taltmann42
@taltmann42
Jan 30 2017 17:40
@philipp32 np np, du auch :D
Muzaffar Hussain
@Muzaffarhssn5
Jan 30 2017 17:41

Can anyone point out mistake i have been doing in this below code.....???

$(document).ready(function() {

function clickFunc() {
var colorArr = ['#16a085', '#27ae60', '#2c3e50', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', "#472E32", "#BDBB99", "#77B1A9", "#73A857"];
var colorNum = Math.floor(Math.random() * colorArr.length);
$('.surround-quote','.buttons').animate({backgroundColor: colorArr[colorNum]},1000);
}

$('#new-quote').on('click', clickFunc);

});

taltmann42
@taltmann42
Jan 30 2017 17:43

@Muzaffarhssn5 as far as I remember, jQuery itself doesn't support animating the background-color. You can either use a jQuery-plugin: https://github.com/jquery/jquery-color
or set the background-color with `$("selector").css("background-color":colorArr[colorNum]);

for the second approach you have to add the following to the elements CSS:

transition: background-color 1s;
the transition-rule can be read like: whenever the value of the background-color changes, this should be done smoothly over the period of 1second
Karthik Nallasivan
@furball514
Jan 30 2017 17:45
How to make a Simon game
?
AJ Robisch
@AJFelidae
Jan 30 2017 17:47
For the "Show the Local Weather" algorithm challenge, does it need to be location adaptive?
Karthik Nallasivan
@furball514
Jan 30 2017 17:47
@Aviendhaast yes
Muzaffar Hussain
@Muzaffarhssn5
Jan 30 2017 17:47
@taltmann42 thank you
CamperBot
@camperbot
Jan 30 2017 17:47
muzaffarhssn5 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 427 | @taltmann42 |http://www.freecodecamp.com/taltmann42
Karthik Nallasivan
@furball514
Jan 30 2017 17:47
Use the ip-api to get location @Aviendhaast
AJ Robisch
@AJFelidae
Jan 30 2017 17:47
@Muzaffarhssn5 Thanks, i'll have to figure that out - been away from FCC for a bit
CamperBot
@camperbot
Jan 30 2017 17:47
aviendhaast sends brownie points to @muzaffarhssn5 :sparkles: :thumbsup: :sparkles:
:cookie: 264 | @muzaffarhssn5 |http://www.freecodecamp.com/muzaffarhssn5
PipsChips
@PipsChips
Jan 30 2017 18:10
Hi! In 'Show the Local Weather' challenge/project, do I have to determine geolocation on my own, and then send those coords as a data in a getJSON request to a server?
Tyler Moeller
@TylerMoeller
Jan 30 2017 18:12
@PipsChips The main requirement is that a visitor can view the weather in their current location. You can do that via Search or automatically with a location API. Either way, yes, a location needs to be sent to a weather API via getJSON, ajax, etc.
PipsChips
@PipsChips
Jan 30 2017 18:12
Or, it's enough to specify URL (already given) in getJSON method, and declare a function to handle given json property:values?
Tyler Moeller
@TylerMoeller
Jan 30 2017 18:12
Some weather APIs get the user's location automatically, like Weather Underground, so you only need one API call.
PipsChips
@PipsChips
Jan 30 2017 18:12
@TylerMoeller
Ok, thnx! I'll try.
CamperBot
@camperbot
Jan 30 2017 18:12
pipschips sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1437 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
PipsChips
@PipsChips
Jan 30 2017 18:13
I'm using one recommended by FreeCodeCamp: https://openweathermap.org/current#geo
Ok. Thnx.
Chris
@bestintown23
Jan 30 2017 18:42
how can i make three images appear in a row, it is now standing vertical but i need them side by side.
Tom
@moT01
Jan 30 2017 18:43
@bestintown23 try display: inline; or something like that
most things are block by default, which take up the whole row, inline stuff will sit side-by-side
i think anyway
Chris
@bestintown23
Jan 30 2017 18:46
@moT01 sounds about right and i actually tried it but it did not work
thanks @moT01
CamperBot
@camperbot
Jan 30 2017 18:46
bestintown23 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 485 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Jan 30 2017 18:46
i would take a look if you wanna share a pen
Chris
@bestintown23
Jan 30 2017 18:47
@moT01 sure let me get it together.
alonl6
@alonl6
Jan 30 2017 18:55
just give them width and float them. float:right (or left)
and you need to clear the float. so If youre not using bootstrap, you need to give clear:both to the html element after the images
Gulsvi
@gulsvi
Jan 30 2017 18:57
images are inline by default. use white-space: nowrap on their parent element.
<div class="parent-div" style="white-space: nowrap">
  <img src="https://placehold.it/640x480">
  <img src="https://placehold.it/640x480">
  <img src="https://placehold.it/640x480">
</div>
alonl6
@alonl6
Jan 30 2017 18:58
you can also give them display:inline:block;
instead of floats
PipsChips
@PipsChips
Jan 30 2017 19:00
Hi! Could someone check my JS part of code (for 'Show the local weather' chalengge/project) for typos and/or mistakes:
http://codepen.io/PipsChips/pen/VPyxJe
I can't even access <p> elements with jQuery selectors; can't see why...'
Moisés Man
@moigithub
Jan 30 2017 19:01
@PipsChips start by opening ur browser devtools (F12 on most browsers)
and go to console tab .. and check IF theres any error
PipsChips
@PipsChips
Jan 30 2017 19:08
@TylerMoeller
Srry :) I know. I tought it would be interesting to learn/try this way.
So, basically I HAVE to create acc, sign in and request a key; either on https://www.wunderground.com/weather/api/d/docs or https://openweathermap.org/current#geo?
Tyler Moeller
@TylerMoeller
Jan 30 2017 19:08
@PipsChips The problem is you'll only learn that navigator.geolocation and openweathermap can't be used together. :/
PipsChips
@PipsChips
Jan 30 2017 19:09
Oh
Yeah, I realized I forgot to add external scripts :)
Icah Banton
@remdata
Jan 30 2017 19:11
I am having the following issue with my WikiSearch challenge. When I click on the search icon it opens a search box/form. When I close that box/form it shows the search icon but it dose not respond when I click on it. Dose anyone know how I can fix that?
PipsChips
@PipsChips
Jan 30 2017 19:12
navigator.geolocation works now (but that's it; I just get long and lat back):
http://codepen.io/PipsChips/pen/VPyxJe
I'll sign up and get kay later. @TylerMoeller @moigithub
Thank you!
CamperBot
@camperbot
Jan 30 2017 19:13
pipschips sends brownie points to @tylermoeller and @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1438 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
:star2: 2638 | @moigithub |http://www.freecodecamp.com/moigithub
PipsChips
@PipsChips
Jan 30 2017 19:14
Just one more Q; is my code-concept ok?
either though it doesn't work? lol
cjljohnson
@cjljohnson
Jan 30 2017 19:20
Why does the button text not update before the minimax algorithm executes? https://codepen.io/cjljohnson/pen/LxLOLP
Moisés Man
@moigithub
Jan 30 2017 19:24
@remdata instead of adding and removing elements.. hide and show em (jquery have methods for that same names)
it doesnt work.. cuz when u remove it also detaches the event handlers (ie. on("click" )
Icah Banton
@remdata
Jan 30 2017 19:28
@moigithub. Thanks.
CamperBot
@camperbot
Jan 30 2017 19:28
remdata sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 2639 | @moigithub |http://www.freecodecamp.com/moigithub
Moisés Man
@moigithub
Jan 30 2017 19:36
@cjljohnson not sure what button text u talking about.. the text above the reset button with numbers 0,-1,-1?
if that.. probably missing a $('#minimax').text(' '); when u click on reset ?
cjljohnson
@cjljohnson
Jan 30 2017 19:37
@moigithub no the actual button text. When i click a button it should update that button to show the player's move before performing them inimax to update the AI's move
but it waits a couple of seconds to do the minimax before updating the player's move on the button text
HollyMarquez
@HollyMarquez
Jan 30 2017 19:38
Is there a place I can upload images for my projects? I know how to reference them when they are local but on codepen they wont be accessible if I just save them locally.
cjljohnson
@cjljohnson
Jan 30 2017 19:38
if (board.isValidMove(x, y)) { button.text(board.turn); board.makeMove(x, y); //console.log(miniMax(board, 0)) } else { return; } if (board.winner() === 0) { var aiMove = miniMax(board, 0); $('#minimax').text(aiMove); $('#' + aiMove[1] + aiMove[2]).text(board.turn); board.makeMove(aiMove[1], aiMove[2]); }
if (board.isValidMove(x, y)) {
    button.text(board.turn);
    board.makeMove(x, y);
    //console.log(miniMax(board, 0))
  } else {
    return;
  }
  if (board.winner() === 0) {
    var aiMove = miniMax(board, 0);
    $('#minimax').text(aiMove);
    $('#' + aiMove[1] + aiMove[2]).text(board.turn);
    board.makeMove(aiMove[1], aiMove[2]);
  }
button.text(board.turn); is the line that updates the button text
and it is before the minimax
so why does it wait for minimax to complete before updating the first button?
Moisés Man
@moigithub
Jan 30 2017 20:08
@cjljohnson http://stackoverflow.com/questions/7342084/jquery-javascript-how-to-wait-for-manipulated-dom-to-update-before-proceeding
wrapping ur "CPU intensive" function inside a settimeout function allow the browser to finish render, before the function gets called
Chinmaya B
@sharang108
Jan 30 2017 20:37
What's the problem with my getjson method there is no outpu
output
anyone?
Karthik Nallasivan
@furball514
Jan 30 2017 20:40
Hey guys i need help how do i get my simon game to continue the sequence along with the previous sound
http://codepen.io/furball/pen/egGPeZ
Tyler Moeller
@TylerMoeller
Jan 30 2017 20:59
@sharang108 Check your developer console for errors - Ctrl+Shift+J, it will tell help you identify the fix.
Yousuf Ejazi
@yousafe007
Jan 30 2017 21:00
Hello campers!
Tyler Moeller
@TylerMoeller
Jan 30 2017 21:01
Hello @yousafe007
isthiswereiputmyusername
@isthiswereiputmyusername
Jan 30 2017 21:02
for codepen project build a tribute page does it need to be about the same guy or any1
Yousuf Ejazi
@yousafe007
Jan 30 2017 21:03
Screen Shot 2017-01-30 at 22.02.13.png
How could i make "max Reger" be right left alligned but right below "Anfang"?
isthiswereiputmyusername
@isthiswereiputmyusername
Jan 30 2017 21:03
ty
Chinmaya B
@sharang108
Jan 30 2017 21:03
@TylerMoeller someone helped me on HelpJavascirpt
script
thanks for your constructive comments.
isthiswereiputmyusername
@isthiswereiputmyusername
Jan 30 2017 21:06
who should i do a tribute page of
Tyler Moeller
@TylerMoeller
Jan 30 2017 21:06
@yousafe007 Check out the text-align property: http://www.w3schools.com/cssref/pr_text_text-align.asp
isthiswereiputmyusername
@isthiswereiputmyusername
Jan 30 2017 21:08
i got it my tribute page is gonna be of.... TheLegend27
Chinmaya B
@sharang108
Jan 30 2017 21:10
@TylerMoeller Yeah but I like the quike because I don't want the dirty work of messing up with APIS
isthiswereiputmyusername
@isthiswereiputmyusername
Jan 30 2017 21:11
that moment when the only good image u find has an url the size of your whole code fml
Simon Cordova
@gbsimon87
Jan 30 2017 21:12
hey guys
http://www.andrewcowderoy.co.uk/new-client-consultation-form
I need to create a form similar to that one, and on submit, have the info sent to as an email
I have no backend experience, any ideas?
or any plugins that may help me?
Chinmaya B
@sharang108
Jan 30 2017 21:13
@TylerMoeller Its again giving me headaches
@TylerMoeller I am signing off just send me Hints or solutions/
Tyler Moeller
@TylerMoeller
Jan 30 2017 21:14
blob
@sharang108 using the console to debug these errors will be important for the harder projects coming up.
Simon Cordova
@gbsimon87
Jan 30 2017 21:15

@TylerMoeller what's up buds

any form plugins you know of?
I need to make a form similar to
http://www.andrewcowderoy.co.uk/new-client-consultation-form
and onsubmit have it send an email with the info

@TylerMoeller I don't know what I'd do without you lol
@TylerMoeller thanks
CamperBot
@camperbot
Jan 30 2017 21:17
gbsimon87 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1439 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Simon Cordova
@gbsimon87
Jan 30 2017 21:19
realistically speaking, how long would it take me to learn some backend code to handle forms?
Shoot, I don't have much experience with npm packages either tbh
npm is just reusing code pretty much right? @TylerMoeller
FrancisOgertschnig
@FrancisOgertschnig
Jan 30 2017 21:22
I'm at the "Build a Random Quote Machine" challenge and frankly don't feel I've learned enough to pull this off. Anyone got any tips? The API section didn't show enough to know how to post a Tweet. I know we're not supposed to look at the code in the example but even that looks like gibberish in the JS section. Feeling overwhelmed.
Tyler Moeller
@TylerMoeller
Jan 30 2017 21:22
You could probably get something working in a couple of days and trust it by the end of the week :)
npm is the node.js package registry, like apt for linux
Simon Cordova
@gbsimon87
Jan 30 2017 21:23
@FrancisOgertschnig to post to a tweet you may want to look at the twitter api...hint hint
@TylerMoeller I'll give it a shot, to learn it, but for now I'll check out the formspree you sent me
@TylerMoeller thanks buds...we'll talk soon
CamperBot
@camperbot
Jan 30 2017 21:23
gbsimon87 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: gbsimon87 already gave tylermoeller points
VilfredSikker
@VilfredSikker
Jan 30 2017 21:24

I have a question about .replace.
I was completing "Check for Palindromes" and researched the internet and instead of writing every "special" character " !&% " etc. A solution would instead be : /[\W_]/g;

I need an explanation of what \ and _ does in this code. I know that W is uppercase words

Dan
@MindWhys
Jan 30 2017 21:25
Hello, can anyone help me to make the qoute generator return new quotes with each click? https://codepen.io/MindWhys/pen/ggoapZ
Tyler Moeller
@TylerMoeller
Jan 30 2017 21:27
@MindWhys Put all your code inside the click function and it should work for you
Dan
@MindWhys
Jan 30 2017 21:30
@TylerMoeller Thanks!
CamperBot
@camperbot
Jan 30 2017 21:30
mindwhys sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1440 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Dan
@MindWhys
Jan 30 2017 21:30
@TylerMoeller Would you please clarify for me why doing that worked?
FrancisOgertschnig
@FrancisOgertschnig
Jan 30 2017 21:31
@TylerMoeller Thanks!
CamperBot
@camperbot
Jan 30 2017 21:31
francisogertschnig sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1441 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
FrancisOgertschnig
@FrancisOgertschnig
Jan 30 2017 21:32
@gbsimon87 Yeah, I already went to their site before posting above.
John Nunns
@johnnunns
Jan 30 2017 21:32
var obj = {
  a: 8,
  b: 2,
  c: 'montana'
}


function removeNumbersLessThan(num, obj) {
return obj.filter(function(number){
    return number >= num;
})
}


removeNumbersLessThan(5, obj)
why is this returning obj.filter is not a function?
Tyler Moeller
@TylerMoeller
Jan 30 2017 21:32
@MindWhys When your web page first loads, it sets the value of x. It only sets that value once. You need to calculate 'x' every time you click the button
So it's a random quote
@johnnunns filter works with arrays, not generic objects
Dan
@MindWhys
Jan 30 2017 21:33
@TylerMoeller It sets it once because it was outside the function...once it is inside the function the number is reset on every click. Got you :)
John Nunns
@johnnunns
Jan 30 2017 21:33
@TylerMoeller could i apply that to all higher order functions @TylerMoeller ?
Dan
@MindWhys
Jan 30 2017 21:34
@TylerMoeller Does that mean I pass that challenge? I didn't use API's. JSON or AJAX...
@TylerMoeller Yes, I suddenly remembered the Twitter part. I also mean to personalise it a bit, I was just wonderin if I had "cheated" by making the random qoute generator within my own javascript
Dan
@MindWhys
Jan 30 2017 21:39
@TylerMoeller OK, good to know...I may do it again using an API just for the practise :)
PipsChips
@PipsChips
Jan 30 2017 21:59
@TylerMoeller
Hi again :)!
I got the key:
http://codepen.io/PipsChips/pen/WRdgGR
João Porfírio
@pixelparker
Jan 30 2017 21:59
hey guys. anyone knows gsap?
PipsChips
@PipsChips
Jan 30 2017 21:59
I was wondering, do I have to use my town's ID?
John Nunns
@johnnunns
Jan 30 2017 22:03
thanks @TylerMoeller
CamperBot
@camperbot
Jan 30 2017 22:03
johnnunns sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1442 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:15
Hi all
just practicing some basic web design, could someone take a look at this and tell me what to improve on? http://codepen.io/hoxtygen/pen/MJrLWP
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:38
@Hoxtygen took a quick look, first off I would say you don't need to add in the <html></html> tags into the HTML section. Codepen automatically wraps all of your code into the necessary parent tags so just write what you would write in between the <body> </body> tags.
Also, the css stylesheets you're linking to, you will want to link directly to the full url by adding them via the settings for your Codepen. If you also want a custom <title></title> for your page, since you don't put that into the HTML section, you can also add that in the Settings.
Edit: Was able to load your website after a few refreshes, might have been my internet
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:39
@itsacoyote thanks for your time... the image wont display though cos i'm having a tough time getting photobucket to work
CamperBot
@camperbot
Jan 30 2017 22:39
hoxtygen sends brownie points to @itsacoyote :sparkles: :thumbsup: :sparkles:
:cookie: 395 | @itsacoyote |http://www.freecodecamp.com/itsacoyote
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:40
@Hoxtygen I don't know of any other sites that might work, perhaps look into imgur for hosting your images?
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:41
@itsacoyote im actually using photobucket for my images, just dont know whats wrong tonight...... any thought on what i put together?
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:42
@Hoxtygen Overall though, looks pretty good to start with! I'd say add some more padding between article posts to make it clear each post is separate. Your images aren't using URLs so nothing is showing for me. Play around with fonts, it can add a nice touch using good fonts on a website, nothing too fancy or crazy though.
The blue on the sidebar is a little strong, I'd go with something slightly lighter and may a slight greyish tone.
For the spacing, an example would be below the Read More button under each article, add something like a 40px or more spacing
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:43
@itsacoyote thanks man......... :thumbsup: :thumbsup:
CamperBot
@camperbot
Jan 30 2017 22:43
hoxtygen sends brownie points to @itsacoyote :sparkles: :thumbsup: :sparkles:
:warning: hoxtygen already gave itsacoyote points
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:44
@Hoxtygen and for fonts, I'd say something along the lines of find a good solid font for headers, and a good font for regular text in content. Your current Trebuchet MS I believe is a little hard to read but your line-height is at a good start.
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:45
is there a number to the maximum amount of color that should appear on a page?
@itsacoyote you're really giving me what i need to hear
Anna Litvinskaya
@arandilme
Jan 30 2017 22:47
Hi all! I'm having troubles with the Random Quote Machine - I'm using Forismatic API, with jsonp, and for some reason, the quotes don't appear on the page. I double- and triple-checked every line, and I'm just stuck :)
I would appreciate any help greatly! Here's my pen: https://codepen.io/arandilme/pen/jyVaJb
(I commented out the tweet button part for the time being, intending to finish it when I've got everything else done.)
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:48
@Hoxtygen Oh, yes! You have three right now, which slightly clash a little bit, but not too bad. I'd suggest for now stick with the regular blue for links, people are very familiar that links are blue so you don't want to confuse that. If you use green in your logo, maybe look at a slightly greyish-green color for the sidebar. Here, let me find a color example...
@Hoxtygen Try a #e4f1e4
I would say stick with one, up to three colors to use, and you can vary them to get different "colors" that are still similar. I picked a light greyish green that I modified from the green on your logo
PipsChips
@PipsChips
Jan 30 2017 22:49
Hi! Could someone pls check my JS part of code for 'Local Weather' project? Thnx.
http://codepen.io/PipsChips/pen/WRdgGR
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:50
@itsacoyote thanks man
CamperBot
@camperbot
Jan 30 2017 22:50
hoxtygen sends brownie points to @itsacoyote :sparkles: :thumbsup: :sparkles:
:warning: hoxtygen already gave itsacoyote points
Idowu Wasiu
@Hoxtygen
Jan 30 2017 22:51
@PipsChips @arandilme Id say try the javascript section........ though i'm through with the random quote machine, i'm about to start the local weather project
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:53
@PipsChips You're getting back an array .list inside your json that you may want to access to get the temp you're looking for.
PipsChips
@PipsChips
Jan 30 2017 22:53
How do you men 'try the Javascript' section? Have you noticed and typos/mistakes?
@itsacoyote
I realized I have entered JSON, and that I'm probably accessing it in a wrong way?
Can you be more specific?
pls :)
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:54
@PipsChips Yep, console.log(json) inside your getJSON call and you can see what the data is returned in your debugger in the browser.
What browser are you using?
Vinicius Costa
@viniciuscrw
Jan 30 2017 22:55
Hello guys! I've made styled navbar buttons in my Personal Portfolio Webpage, and now I want to know if there is some way to make the buttons in the navbar appear "active" or "pressed" when clicked and while navigating the current page. Could anyone help me with that? Here is the page: http://codepen.io/viniciuscrw/full/GjVZGZ/
PipsChips
@PipsChips
Jan 30 2017 22:55
ok goona try it now thnx
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:55
@PipsChips for example the name of the city you can access as json.city.name
Moisés Man
@moigithub
Jan 30 2017 22:56
@arandilme var url = "http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?"; use format=jsonp
and open ur codepen without httpS
cuz ur content (forismatic) uses only http (else u will get mixed content error)
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:57
@viniciuscrw having a look now
PipsChips
@PipsChips
Jan 30 2017 22:57
@itsacoyote
I'm using Mozilla
Firefox*
Sabrina Ferguson
@itsacoyote
Jan 30 2017 22:58
@PipsChips ok, just checking, if you know how to use and access the debugger/developer tools window
PipsChips
@PipsChips
Jan 30 2017 22:58
well, not as agood as i would want to :)
for example
i was following this: http://openweathermap.org/current
at the top bottom of the page
Anna Litvinskaya
@arandilme
Jan 30 2017 22:59
@moigithub OH DEAR. Thank you so much! I thought I checked every instance of json and replaced it with jsonp, but I did miss this one :) Thank youuuu!
CamperBot
@camperbot
Jan 30 2017 22:59
arandilme sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 2640 | @moigithub |http://www.freecodecamp.com/moigithub
Andy
@andythedandyone
Jan 30 2017 23:01
@PipsChips you have to split that url ... example: var url = 'http://api.openweathermap.org/data/2.5/weather?' + zipcode + long + lat etc
then use + to add coords or city or zip etc.
PipsChips
@PipsChips
Jan 30 2017 23:02
@itsacoyote @andythedandyone Thank you!
CamperBot
@camperbot
Jan 30 2017 23:02
pipschips sends brownie points to @itsacoyote and @andythedandyone :sparkles: :thumbsup: :sparkles:
:cookie: 266 | @andythedandyone |http://www.freecodecamp.com/andythedandyone
:cookie: 397 | @itsacoyote |http://www.freecodecamp.com/itsacoyote
PipsChips
@PipsChips
Jan 30 2017 23:03
I have some result :) finally
Even though I get local weather for some random (not mine) city :)
Andy
@andythedandyone
Jan 30 2017 23:06
you shouldn't rely on the browser ability to provide coords, in case user disable it, you have no data. Use as an alternate method for this case another way to fetch user location. such as 'http://ipinfo.io'
i meant, rely solely on the browser
PipsChips
@PipsChips
Jan 30 2017 23:08
I'm gonna try smthing different first. I'm getting the results for Moscow (not my city). But i have realized that my API has Moscow ID (of course)
I'm gonna try to find my ID
Icah Banton
@remdata
Jan 30 2017 23:29
Hello. I know how to respond to a button click, but how do you respond when a user press enter on a form?
Rennie Bevineau
@Renniesb
Jan 30 2017 23:33
How do I make this button change color when it is clicked and change back when it is clicked again
xemexpress
@xemexpress
Jan 30 2017 23:49

I am doing the quote machine and want to add a transition effect when the color changed. I tried adding transition to CSS (say like adding to body

body {
...
transition: background-color 1s ease;
}

but it doesn't work. What should I do?
http://codepen.io/xemexpress/pen/JEMbBb

Bigyan Karki
@bigyankarki
Jan 30 2017 23:50
unction getData() {
  $.ajax({
    url: "https://en.wikipedia.org/w/api.php",
    dataType: "jsonp",
    data: "queryData",
    type: "GET",
    headers: {"api-user-agent" : "b.gyankarki@gmail.com"},
    success: function(wiki) {

    }
  });
}
@TylerMoeller hi how are you doing?
I am currently doingthe wikipedia viewer
and i was qondering what query i should enter to get atleast 20 related entries
Tyler Moeller
@TylerMoeller
Jan 30 2017 23:54
@xemexpress You could fade out the body and then fade eveything back in as one option:
$("body").css("background-color", someRandomColor).fadeOut(1000, function() {
  //make any other style changes, html updates, etc..
}).fadeIn(1000);
@bigyankarki It's been a while, I'd have to go back to the API docs for that one :)
Have you tried their API Sandbox?
Bigyan Karki
@bigyankarki
Jan 30 2017 23:55
nope
Rennie Bevineau
@Renniesb
Jan 30 2017 23:57
@Renniesb
How do I make this button change color when it is clicked and change back when it is clicked again
http://jsfiddle.net/Tiquismiquis/o1n7uw6x/33/
Tyler Moeller
@TylerMoeller
Jan 30 2017 23:58
@bigyankarki This is a good tool for learning how to use the API: https://www.mediawiki.org/wiki/Special:ApiSandbox
Expect to spend a few hours studying it - that API is a challenging one