These are chat archives for FreeCodeCamp/HelpFrontEnd

5th
Apr 2016
Stephen James
@sjames1958gm
Apr 05 2016 00:00
Don't do async: false
Chris
@The-Mister
Apr 05 2016 00:00
@TylerMoeller oh wow, completely forgot about .forEach. So much simpler than a full for loop! I will try this out. I'm very unfamiliar with ajax calls, so I'll have to read up on them! @sjames1958gm Why would this not work?
Tyler Moeller
@TylerMoeller
Apr 05 2016 00:01
async: false stops everything until the requests are complete - it can make your app unresponsive with really big request. Best to use callbacks + promises for larger projects
Chris
@The-Mister
Apr 05 2016 00:03
Is that not OK to use for small projects with a small array, or should I just learn how to use promises and callbacks?
Andrew Schmidthuber
@calicode
Apr 05 2016 00:03
angular question, trying to pass a ng-show a value but think i'm doing it wrong. right now i have ng-show='checkShow()' which will return this.show from an object that will be 'val.stream' or '!val.stream'. my tab set function refreshes $scope.object each time.
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:04

Btw anybody knows why this

html = 
          '<tr class="' + status + ' clickable-row" onclick="console.log("' + data.url + '")">'

is giving me that as a result in html

<tr class="online clickable-row" onclick="console.log(" www.twitch.tv="" https:https:="" sodapoppin)"="">

Tyler Moeller
@TylerMoeller
Apr 05 2016 00:04
@The-Mister I think it's fine for a small project like this, but it is discouraged for the reason I mentioned above. We haven't had a lot of training on promises and callbacks here in FCC, so it is an option.
Chris
@The-Mister
Apr 05 2016 00:04
@Wint3rNuk3 your quotations are a little messed up
@TylerMoeller Ok thank you for the direction. Will use the async as a quick fix as I read up on promises and callbacks. Thank you, too, @sjames1958gm and @0x0936 !!!!
CamperBot
@camperbot
Apr 05 2016 00:05
the-mister sends brownie points to @tylermoeller and @sjames1958gm and @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 491 | @tylermoeller | http://www.freecodecamp.com/tylermoeller
:star: 1260 | @0x0936 | http://www.freecodecamp.com/0x0936
:star: 436 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:06
I laughed x) @The-Mister my butt is pretty hurt atm too much quotations kills quotations, I guess i'll have to rewrite haha
max77p
@max77p
Apr 05 2016 00:07
quick question
<div class="temp">&#8451</div>
i want to be able to put the degrees celcius next to whatever temp is
how do i do it
so basically lets say 3 'C
pretend ' is degree sign
i want it on the same line and not breaking onto 2nd line
help please?
CamperBot
@camperbot
Apr 05 2016 00:08

:point_right: algorithm no repeats please [wiki]

Problem Explanation:

  • This task requires us to look at each possible permutation of a string. This is best done using a recursion function. Being able to build a function which collects all permutations of a string is a common interview question, so there is no shortage of tutorials out there on how to do this, in many different code languages.
  • This task can still be daunting even after watching a tutorial. You will want to send each new use of the function 3 inputs: 1. a new string (or character array) that is being built, 2. a position in your new string that's going to be filled next, and 3. an idea of what characters (more specifically positions) from the original string have yet to be used. The pseudo code will look something like this:

    ```
    var str = ???;
    perm(current position in original string, what's been used in original string, current string build thus far){
    if(current string is finished) {
    print current string;
    }else{
    for(var i = 0; i < str.length; i++) {

    if(str[i] has not been used) {
      put str[i] into the current position;
      mark str[i] as used
      perm(current position in original string, what's been used in original string, current string build thus far)
      unmark str[i] as used because another branch in the tree for i + 1 will still likely use it;
    }

    }
    }
    }
    :pencil: read more about algorithm no repeats please on the FCC Wiki

Andrew Schmidthuber
@calicode
Apr 05 2016 00:08
@max77p this is how i did it

var degreeSign = "00B0";

degreeSign = String.fromCharCode(parseInt(degreeSign, 16));

var degreeSign = "00B0";

degreeSign = String.fromCharCode(parseInt(degreeSign, 16));
max77p
@max77p
Apr 05 2016 00:10
@calicode think i may have confused you lol
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:10
@max77p don't use a div for your celcius sign
max77p
@max77p
Apr 05 2016 00:11
i changed it @Wint3rNuk3 ...but for now i just want to get the degree celcius on the same line beside the number
besides doing css adjustments how can i get it to do that just through html?
Andrew Schmidthuber
@calicode
Apr 05 2016 00:11
oh
yea do just <span> </span>
max77p
@max77p
Apr 05 2016 00:12
on the degree celcius item inside the p tags?
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:13
use span
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:13
for your .temp AND for your Celcius
max77p
@max77p
Apr 05 2016 00:13
tried it here, but not sure i am doing it right
sorry i think this is a easy fix, just can't seem to figure it out lol
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:13
<span class="temp"></span><span>&#8451</span>
this would work
max77p
@max77p
Apr 05 2016 00:14
@Wint3rNuk3 ahh it does! why is that? just want to understand it better
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:14

@max77p Definition and Usage

The <span> tag is used to group inline-elements in a document.

The <span> tag provides no visual change by itself.

The <span> tag provides a way to add a hook to a part of a text or a part of a document.

Bruce Young
@mutantspore
Apr 05 2016 00:14
@max77p <p> causes a new line break
max77p
@max77p
Apr 05 2016 00:15
ahh perfect, thanks guys! @mutantspore @Wint3rNuk3 @calicode
Andrew Schmidthuber
@calicode
Apr 05 2016 00:15
if you want more read up on inline vs block elements
Robert Richey
@0x0936
Apr 05 2016 00:20
@The-Mister when browsers support the spread operator, you can write this:
var allStreams = [];

var twitch = function(streamer) {
  return new Promise((resolve, reject) => {
    $.ajax({
     url: 'https://api.twitch.tv/kraken/streams/' + streamer,
     success: resolve,
     error: reject
   })
  })
}

var streamers = [
  twitch('freecodecamp'),
  twitch('storbeck'),
  twitch('monstercat')
]

Promise.all([...streamers])
  .then((data) => {
    allStreams.push(data)
    console.log('done', allStreams)
  })
Alex Coder
@jkid314159
Apr 05 2016 00:26
Hello World!
CamperBot
@camperbot
Apr 05 2016 00:26

welcome to FreeCodeCamp @jkid314159!

max77p
@max77p
Apr 05 2016 00:27
quick question, which ip location service did you guys use for the weather app?
Alex Coder
@jkid314159
Apr 05 2016 00:27
I want to change the Bootstrap row and added this css:

row1 .row {

"background-color": "#FF66FF";
}
not working???
max77p
@max77p
Apr 05 2016 00:27
i find the one i am using is not as accurate to location, its still produces same temp in area, but not accurate location wise
Chris
@The-Mister
Apr 05 2016 00:28
@0x0936 wow thank you! I will definitely be picking through that and reading the docs on the syntax. Thank you a ton!
CamperBot
@camperbot
Apr 05 2016 00:28
the-mister sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: the-mister already gave 0x0936 points
Robert Richey
@0x0936
Apr 05 2016 00:30
@The-Mister I changed that example to use the spread operator. currently, afaik, browsers don't support it, but you can transpile your code using Babel if you feel up to it
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:31
console.log("<tr class=\"" + status + " clickable-row\" " +  "onclick=\"" + "console.log" + "(" + "\"" + data.url + "\")\">");

gives me the right thing BUT

html = 
          "<tr class=\"" + status + " clickable-row\" " +  "onclick=\"" + "console.log" + "(" + "\"" + data.url + "\")\">"

gives me a nice

<tr class="online clickable-row" onclick="console.log(" www.twitch.tv="" https:https:="" sodapoppin)"="">
max77p
@max77p
Apr 05 2016 00:31
@Wint3rNuk3 did you do the weather app? if so wondering which location api you used?
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:32
max77p
@max77p
Apr 05 2016 00:33
@Wint3rNuk3 yea i am using this, but i need to pull users location to feed it to that no?
in my js i have an api that first pulls the location, then feeds it to the openweathermap api
Stephen James
@sjames1958gm
Apr 05 2016 00:34
@max77p You can use the geolocation API from the broswer
Bruce Young
@mutantspore
Apr 05 2016 00:34
@max77p or something like http://ip-api.com/
Robert Richey
@0x0936
Apr 05 2016 00:35
@jkid314159 don't quote the property or value. background-color: #F6F;
max77p
@max77p
Apr 05 2016 00:35
@Wint3rNuk3 @mutantspore i know about geolocation, but opted not to use that because it asks the user...instead i wanted to automatically pull the info
Bruce Young
@mutantspore
Apr 05 2016 00:35
look at my second suggestion then
Alex Coder
@jkid314159
Apr 05 2016 00:35
@0x0936 changed no affect
Bruce Young
@mutantspore
Apr 05 2016 00:35
@max77p
max77p
@max77p
Apr 05 2016 00:35
@mutantspore yea ip api is what i am using, but location is a little off, thats why was wondering if there was another one like that
thanks though @mutantspore
CamperBot
@camperbot
Apr 05 2016 00:35
max77p sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1363 | @mutantspore | http://www.freecodecamp.com/mutantspore
Robert Richey
@0x0936
Apr 05 2016 00:37
@jkid314159 background-color is still quoted. and you're trying to use HTML comments inside CSS - doesn't work. CSS comments only use /* this is a comment in CSS */
@jkid314159 your HTML element with id="row1" also contains class="row". To target this element in CSS, do not use the descendant selector (a space) between selectors. #row1.row is how you could select that element. Or you could select it using either #row1 or .row depending on what you're trying to achieve.
Robert Richey
@0x0936
Apr 05 2016 00:46
@The-Mister looks like I was mistaken - spread operator (and promises) are mostly supported in modern browsers - https://kangax.github.io/compat-table/es6/
:)
Wint3rNuk3
@Wint3rNuk3
Apr 05 2016 00:47
ok it's late in France, seeyall later
Robert Richey
@0x0936
Apr 05 2016 00:48
@Wint3rNuk3 :wave:
max77p
@max77p
Apr 05 2016 01:07
@mutantspore how would i call something like this "weather":[{"id":804,"main":"clouds","description":"overcast clouds","icon":"04n"}]
i want to call weather.main but that is not working
in this example "main":{"temp":289.5,"humidity":89,"pressure":1013,"temp_min":287.04,"temp_max":292.04} if i call main.temp it works
if anyone can chime in that would be great! thanks
traducer
@traducer
Apr 05 2016 01:13
hey guys can anyone tell me if my game of life is working? http://traducer.github.io/react-gameOfLife/
henrywashere
@henrywashere
Apr 05 2016 01:14
question...if you look at the portfolio section of my webpage and resize(shrink) your browser, you see 4 thumbnails to the left side and only 2 on the right. how do i even that out and have 3 on each side???
http://codepen.io/henrywashere/pen/XdXxRO
Robert Richey
@0x0936
Apr 05 2016 01:17
@max77p your first example is an array with one object as it's only element. To access this object, use bracket notation weather[0] then you can use dot notation to access the properties of this object weather[0].main
Kevin Mulligan
@kmulligan
Apr 05 2016 01:17
@henrywashere how do you have the images/placeholders nested inside of bootstrap
max77p
@max77p
Apr 05 2016 01:18
@0x0936 ohhh ic, that makes sense. thank you!
CamperBot
@camperbot
Apr 05 2016 01:18
max77p sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 1261 | @0x0936 | http://www.freecodecamp.com/0x0936
Kevin Mulligan
@kmulligan
Apr 05 2016 01:19
@henrywashere Not seeing 4 and 2, I'm seeing
2
1
2
1
because you have 3 to a row and they don't all fit when the screen size shirnks
@henrywashere I am seeing some weird interaction with your contact section once you shrink the screen size down, you get the above 2 - 1 -2 -1 images and then next to the last image your contact stuff is squeezed in
henrywashere
@henrywashere
Apr 05 2016 01:24
ya im seeing that too
how do i fix this? lol
henrywashere
@henrywashere
Apr 05 2016 01:39
anyone????
henrywashere
@henrywashere
Apr 05 2016 01:52
it worked, but now im seeing grey blocks on the right and left side of the contact section
Bruce Young
@mutantspore
Apr 05 2016 01:54
ok look again .. got carried away with removing divs
@henrywashere
@henrywashere yes? no?
henrywashere
@henrywashere
Apr 05 2016 02:00
it worked, but im trying to figure out what you changes
changed*
thanks @mutantspore
CamperBot
@camperbot
Apr 05 2016 02:00
henrywashere sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1364 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Apr 05 2016 02:03
all the projects are in one row now, the col-sm-4 bit decides how many should be in a row as it will add up to 12. I also put the smaller size first .. I’d suggest that you change col-xs-6 to col-xs-12 so it wil be one col on a phone.
@henrywashere
henrywashere
@henrywashere
Apr 05 2016 02:04
THANK YOU!!!!!!!
Mauricio
@maudevelop
Apr 05 2016 03:48
is there any recommended CSS course? I feel like every project I start its such a pain to set up the margins and everything and i end up with an extremely hacky css to center stuff and etc
Henry Quinn
@Quinncuatro
Apr 05 2016 03:49
That's a good question
I got lucky and had an html/css class in college.
I'd love to have a little more standardization to it.
Mauricio
@maudevelop
Apr 05 2016 03:52
http://codepen.io/maudevelop/pen/KzyWZV is that a correct way to center things horizontally/vertically? And how to center the input text thing?
been watching many css videos i can't get that simple thing down hahah
other projects i kinda started with a bootstrap template so it was easier to get hacky css things down but want to actually understand it now
like my last project www.mauriciomaigre.com/weather if you look at the css its such a mess haha
James Hall
@James-H33
Apr 05 2016 04:03
@maudevelop I centered it for you. http://codepen.io/James-H33/pen/JXOWpp
Mauricio
@maudevelop
Apr 05 2016 04:04
@James-H33 awesome! thanks :D
CamperBot
@camperbot
Apr 05 2016 04:04
maudevelop sends brownie points to @james-h33 :sparkles: :thumbsup: :sparkles:
:star: 18 | @james-h33 | http://www.freecodecamp.com/james-h33
James Hall
@James-H33
Apr 05 2016 04:07
@maudevelop no problem. Here is an example of something I did today. If you want to just get a look at how to organize your code a bit. I'm not a professional by any means though. http://codepen.io/James-H33/pen/reYLjX
96street
@96street
Apr 05 2016 04:13
http://codepen.io/anon/pen/zqPZjd Why won't last-child work here?
Jose Barakat
@JoseBarakat
Apr 05 2016 04:15
Please can someone help me with "Exact Change"?
Thái Salem
@kazan221
Apr 05 2016 04:59
@JoseBarakat yes i can
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:14
Hello, all
Chad Kreutzer
@ChadKreutzer
Apr 05 2016 05:15
@JoseBarakat what are you having problems with?
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:15
I just finished my Wiki search page. http://codepen.io/richhopkins/full/KzXjgb/
Chad Kreutzer
@ChadKreutzer
Apr 05 2016 05:18
@Rich-Hopkins it looks good. I like the background image. You might make the result divs a little narrower: I get a horizontal scroll when they pop up. also, I'd change the appearance of a visited link on the search button cause after you click it once, an ugly blue square shows up over it.
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:20
Good tips. I couldn't figure out how to make the scroll up when the results populate, though. And I only visited a couple links, so I didn't notice the blue, but now I do.
for the background, I figured for an encyclopedia lookup, there wasn't a better image than the reading room of the Library of Congress.
@ChadKreutzer thanks
CamperBot
@camperbot
Apr 05 2016 05:21
rich-hopkins sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 529 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Chad Kreutzer
@ChadKreutzer
Apr 05 2016 05:31
@Rich-Hopkins I'm trying to figure out which of your elements is too wide.
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:32
I just narrowed the results
And I'm not seeing the blue square you're talking about.
whoops that just shows the scroll. I meant to share one that showed the blue box.
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:40
Oh, but now I see what you were talking about with scroll. I was thinking along the lines of animating the search box div moving to the top. Now I see you are talking about scrollbar on the side.
Chad Kreutzer
@ChadKreutzer
Apr 05 2016 05:42
on the bottom actually, the side one isn't a big deal, cause people expect to scroll up and down.
here we go. notice the little blue box over the search button: https://www.dropbox.com/s/hu7l562hyrpod18/2016-04-04%20%281%29.png?dl=1
Mauricio
@maudevelop
Apr 05 2016 05:45
How would i be able to apply CSS to appended items after execution ?

function jsonpCallback(json) {
    'use strict';
    parsedJson = JSON.parse(JSON.stringify(json));
    results= parsedJson.query.search;
    for (i = 0; i < results.length; i = i + 1) {

        $("#searchResults").append("<div class = well resultItem > <b>" + results[i].title + "</b> </div>");
    }
}
i have this right now
just apply the css to #searchResults? or is there a better way of dynamically adding html stuff?
yhakong
@yhakong
Apr 05 2016 05:46

Can't see why my DNA pairing function does not work

function pair(str) {
var long_arr = [];
var short_arr = [];

for(var i = 0; i < str.length; i++) {
short_arr.push(str.charAt(i));
short_arr.push(returnMatching(str.charAt(i)));
long_arr.push(short_arr);
short_arr = [];
}

return long_arr;
}

function returnMatching(char) {
switch (char) {
case 'A': {
return "T";
}
case "T": {
return "A";
}
case "C": {
return "G";
}
case "G": {
return "C";
}
}
}

pair("ATCGA");

Chad Kreutzer
@ChadKreutzer
Apr 05 2016 05:48
I suppose I shoulda tagged you up there, @Rich-Hopkins :D
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:49
@maudevelop I wouldn't add a div. What I did was put a <ul> in my html, then with jQuery appended an <li> to the <ul>
I see it, Chad. I wasn't looking in the right place. That's just there because the button has the focus. I tried putting the focus on the input box, but it doesn't seem to work since it's hidden.
why is not working xD
Mauricio
@maudevelop
Apr 05 2016 05:53
@Rich-Hopkins alright good idea, thanks, and by the way is that an appropriate way to dynamically add html elements or is there a better way?
CamperBot
@camperbot
Apr 05 2016 05:53
maudevelop sends brownie points to @rich-hopkins :sparkles: :thumbsup: :sparkles:
:star: 293 | @rich-hopkins | http://www.freecodecamp.com/rich-hopkins
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:53
also, @maudevelop , I'm not seeing the element with the #searchResults id.
Elbert Cortez
@trip16661
Apr 05 2016 05:54
it was working yesterday D:
Mauricio
@maudevelop
Apr 05 2016 05:54
@Rich-Hopkins, it's just a div i added on the html
named that way
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 05:55
Ok, you must not have saved because I don't see it.
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 06:05
@trip16661 look at your api url. Is it correct? With two distinct URLs put together? If so, then that website appears to be offline.
Shivam Arora
@shivamarora13
Apr 05 2016 06:11
I have some problem, can anybody see my pen and tell me why is it occurring, when I call my array elements through Index in getJSON, they give appropriate results, but when I use it in IF condition, inside getJSON, it doesn't, can you tell why?
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 06:12
Can't see your pen.
Shivam Arora
@shivamarora13
Apr 05 2016 06:13
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 06:17
Ok - Maybe it's late and I should be in bed, or maybe I don't get it because I'm going to start this zipline tomorrow (probably), but help me out with where the problem is.
Shivam Arora
@shivamarora13
Apr 05 2016 06:19
@Rich-Hopkins i have put comments, after the statements, where problems exist.
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 06:27
I'm sorry, @shivamarora13. I'm not seeing what the problem is. I see your comments now, but I'm still trying to wrap my head around json.
qeurago
@qeurago
Apr 05 2016 06:29
how exactly am i meant to start these intermediate front end projects? i go from doing useless exercises with arrays to practical exercises with javascript that hasn't been taught before? what?
kirbyedy
@kirbyedy
Apr 05 2016 06:33
@qeurago it says there... read, search, ask
google is your friend
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 06:33
@kirbyedy thanks
CamperBot
@camperbot
Apr 05 2016 06:33
rich-hopkins sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 803 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
qeurago
@qeurago
Apr 05 2016 06:34
yeah i know i can google it but shouldn't this stuff have been taught before?
usually when you have practical exercises they would be using material from prior lessons...
Rich Hopkins
@Rich-Hopkins
Apr 05 2016 06:34
You've got most of what it takes. A good developer doesn't know everything. He knows how to find everything.
kirbyedy
@kirbyedy
Apr 05 2016 06:34
well FCC has a different way of teaching, they show you some basics and then you are on your own, to dig out and learn things you need
they do not "spoon feed you" with things you need to know
you have to find it for yourself
and again... google is your friend
qeurago
@qeurago
Apr 05 2016 06:37
whats the point of the course if it doesn't teach you what you need to know?
kirbyedy
@kirbyedy
Apr 05 2016 06:37
they do teach you some basics
maybe you should check some other online courses where you work with a tutor, and they tell you what to type in the editor
but that one will cost more that 10000$
qeurago
@qeurago
Apr 05 2016 06:42
thanks for your smartass response, but that's not what i'm looking for. i'm looking for a course that will actually teach me what i need to know to do practical exercises
it was good when i did the html/css part, but javascript is just a mess
kirbyedy
@kirbyedy
Apr 05 2016 06:42
good luck
Is it okay or too simple enough haha
kirbyedy
@kirbyedy
Apr 05 2016 06:43
@maudevelop your logo is missing :(
Mauricio
@maudevelop
Apr 05 2016 06:43
Hmm, it's showing here, maybe imgur is not working well on the embeds on codepen haha
kirbyedy
@kirbyedy
Apr 05 2016 06:44
avoid using imgur lots of people have problem hotlinking images
qeurago
@qeurago
Apr 05 2016 06:45
hotlinking images from the biggest image host on the internet doesn't work, hmm seems like a good website
better haha
Robert Uivarosi
@URobert
Apr 05 2016 06:45
from what I recall
imgur blocked codepen
Szuyin Yu
@Rosalyn0403
Apr 05 2016 06:47
Hi everyone, I am doing the "Style the HTML Body Element" exercise, but may need some help...
Robert Uivarosi
@URobert
Apr 05 2016 06:47
it's not like there aren't a lot of other options out there for hotlinking
@Rosalyn0403 let's see what you have so fa
r
Szuyin Yu
@Rosalyn0403
Apr 05 2016 06:47
  .body{
    background-color:black;
  }
</style>
<body class="body">  </body>
<style>
  .body{
    background-color:black;
  }
</style>
<body class="body">  </body>
this is what i have. but I cannot pass the second requirement - "Make sure your CSS rule is properly formatted with both opening and closing curly brackets."
Coy Sanders
@coymeetsworld
Apr 05 2016 06:49
@Rosalyn0403 you don't need to make your selector a class, remove the . so it just says body
and remove class="body", that should work
your code will work but you don't need all that, maybe the validator expects something different thats why its failing
Szuyin Yu
@Rosalyn0403
Apr 05 2016 06:50
@coymeetsworld Thank you very much! It works :)
CamperBot
@camperbot
Apr 05 2016 06:50
rosalyn0403 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 464 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Apr 05 2016 06:51
awesome, good job @Rosalyn0403 :thumbsup:
Szuyin Yu
@Rosalyn0403
Apr 05 2016 06:53
thanks !!
S.L. Ting
@palden
Apr 05 2016 07:29
Anyone knows what’s the differrence in completing advanced algorithm challenges or not, since it is not required for the front-end certification? :-)
other than the learning experience
kirbyedy
@kirbyedy
Apr 05 2016 07:37
@palden every experience is good
S.L. Ting
@palden
Apr 05 2016 07:38
@kirbyedy noted :-)
Robert Uivarosi
@URobert
Apr 05 2016 07:44
@palden it's not the certificate that really matters, but the experience you gather wile getting it
faraz
@silentarrowz
Apr 05 2016 09:06
is anyone into algorithms here?? I am learning data structures and algorithms and thus writing code for quicksort. It's just that when I am recursively calling the quicksort function, it gets into an infinite loop. could you tell me what's wrong?? here's the link - http://codepen.io/silentarrowz/pen/PNJRJe
kwal0203
@kwal0203
Apr 05 2016 09:10
Can anybody help me with the weather app? it's driving me insane.
I can do it all except for the toggle back and forth between Fahreinheit and degrees celsius
kirbyedy
@kirbyedy
Apr 05 2016 09:19
@kwal0203 link your pen here, and someone will try to help
kwal0203
@kwal0203
Apr 05 2016 09:20
@kirbyedy thanks, I'm just trying one more thing. If I can't get it I'll link here
CamperBot
@camperbot
Apr 05 2016 09:20
kwal0203 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 804 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
kirbyedy
@kirbyedy
Apr 05 2016 09:23
basically its a jquery hide/show
kwal0203
@kwal0203
Apr 05 2016 09:24
@kirbyedy ohhh, is that it
I'll try that as well, i've been trying to get it too work using jQuery .data
kwal0203
@kwal0203
Apr 05 2016 09:28
@kirbyedy isn't toggle deprecated and removed from jQuery?
kirbyedy
@kirbyedy
Apr 05 2016 09:28
dont know... is it ?
kwal0203
@kwal0203
Apr 05 2016 09:29
I read it somewhere. Apparently they had two .toggle functions. Maybe this is the one that was left in
toggle and toggle-event must be different
kirbyedy
@kirbyedy
Apr 05 2016 09:31
if you dont want the toggle, I guess you can use the hide/show then
kwal0203
@kwal0203
Apr 05 2016 09:31
what did you use?
kirbyedy
@kirbyedy
Apr 05 2016 09:32
so on click, you hide celsius, and show fahrenheit
and vice versa
I used toggle
kwal0203
@kwal0203
Apr 05 2016 09:32
yeah I want to try and do it with toggle
Alexander Sääf
@alexsaaf
Apr 05 2016 09:50
Hey guys, I am working on the wikipedia viewer and I'm having some issues with calling the API
I am using $.get(string,function(){ etc. , Where the string is "https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=" + the search input + "&utf8=&format=json"
But when I log something in the function, nothing happens
Any idea of what I am missing?
Also, the string does give the right response if I paste it into my browser
kirbyedy
@kirbyedy
Apr 05 2016 10:02
@alexsaaf most probably you are missing the callback
Alexander Sääf
@alexsaaf
Apr 05 2016 10:13
Hmm ok, how do I solve that?
kirbyedy
@kirbyedy
Apr 05 2016 10:17
try to put callback=? in your line
Alexander Sääf
@alexsaaf
Apr 05 2016 10:17
Ah thanks, just got it working doing just that
Thanks :)
Hey guys, any help appreciated I can't get the toggle function to work to switch between celsius and fahreinheight
Stephen James
@sjames1958gm
Apr 05 2016 10:45
@kwal0203 If you add query parm units=metric vs units=imperial it will return the correct unit. On toggle just recall you get Weather function and update the weather
kwal0203
@kwal0203
Apr 05 2016 10:47
@sjames1958gm Hi Stephen, what do you mean by 'query parm'?
Greg Duncan
@GregatGit
Apr 05 2016 11:16
@kwal0203 @kwal0203 A simple if statement should do the trick
if (temp is fahrenhiet){
   change to celsius;
}else{
  change to fahrenheit;
}
Hari Adhikari
@harryac07
Apr 05 2016 11:28
hello I am stuck in Wikipedia Api. I couldnot understand the Json. Anybody there to help me understand this project??
Thanks in advance :smile:
Stephen James
@sjames1958gm
Apr 05 2016 11:30
@kwal0203 query parms are the name=value pairs in your URL
kwal0203
@kwal0203
Apr 05 2016 11:35
Thanks guys, I got it working
Hari Adhikari
@harryac07
Apr 05 2016 12:13
@GregatGit the link is not working . Dunno why. I tried to fetch json string but i didnt get.
I used my previous link. But basic one.
http://en.wikipedia.org/w/api.php?format=json&action=query&titles=germany&prop=revisions&rvprop=content&callback=?
what about chahing search to title in your link ??
Greg Duncan
@GregatGit
Apr 05 2016 12:15
@harryac07 Just click on the link I posted and see if anything comes up
Hari Adhikari
@harryac07
Apr 05 2016 12:15
ah yeah it worked man
Greg Duncan
@GregatGit
Apr 05 2016 12:16
can you put your pen up
Hari Adhikari
@harryac07
Apr 05 2016 12:17
@GregatGit thanks . yeah i will try to upload first. coz I am using different editing tool.
CamperBot
@camperbot
Apr 05 2016 12:17
harryac07 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:star: 396 | @gregatgit | http://www.freecodecamp.com/gregatgit
Greg Duncan
@GregatGit
Apr 05 2016 12:18
@harryac07 I highly recommend using code pen - if you have any problems other campers can easily look and see where your problem is

@harryac07 here is how I got my json working

 $.getJSON(myUrl, function(json) {
    buildHtml(json);
  });

buildHtml is function a wrote

myUrl was the the link I showed you before
Hari Adhikari
@harryac07
Apr 05 2016 12:23
@GregatGit yeah man. I was doing so. But now I am stuck in fetching the individual link from the api pages. Like if I search for germany. I want many links related to germany..
How to make it happen?
Greg Duncan
@GregatGit
Apr 05 2016 12:25
Do you mean how to get the different bit of info from the different pages?
Hari Adhikari
@harryac07
Apr 05 2016 12:25
yeah
Greg Duncan
@GregatGit
Apr 05 2016 12:27
You need to lookup Oject.key() function
also just click the link - copy all the info and take it over to www.repl.it - turn it into an object so var myObj = and try to get bit of info out using console.log()
Greg Duncan
@GregatGit
Apr 05 2016 12:32
@harryac07 Here is a line of code I used but you have to understand Oject.key function
the obj was the json I downloaded
var myKeys = Object.keys(obj.query.pages);
Hari Adhikari
@harryac07
Apr 05 2016 12:32

for example,

"query": {
        "pages": {
            "20256535": {
                "pageid": 20256535,

here I did,
query.pages.20256535.pageid
But how do I know the total pages? Or should we use loop until the end of page?
I am actually having problem on it

Wojciech Kałużny
@mrkaluzny
Apr 05 2016 12:36
Any idea why this code doesn’t work?!
$.getJSON(api + searchQuery, function(data) {
          $('#test').html(JSON.stringify(data));
        alert("success”);
      });
Greg Duncan
@GregatGit
Apr 05 2016 12:40
@mrkaluzny put alert(data); before your query to see what your getting - should say object
@mrkaluzny also try putting your api and searchQuery directly into the browser to see if they work
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 12:45

@GregatGit API & searchQuery both works. When I set a variable to be equal to $.getJSON(api+ searchQuery) it alerts [object Object] which means it gets data from the link, but doesn’t run the success function.

I have no idea what to do.

Greg Duncan
@GregatGit
Apr 05 2016 12:45
put your pen up
It's very hard to debug code when you can't see it
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:05
usharya
@usharya
Apr 05 2016 13:07
quick question
how can I achieve this effect?
https://gyazo.com/55052e08343798e9d24394c26ccd4ff8
Sephem
@Sephem
Apr 05 2016 13:11
Hi,why would $.ajax() not return success evrytime I run it using the same paramaters?
Lanitta
@DivaWeb
Apr 05 2016 13:12
@usharya you can use onclick in jquery
Sephem
@Sephem
Apr 05 2016 13:12
$.ajax({
      url: "http://en.wikipedia.org//w/api.php",
      dataType: "jsonp",
      data: {
        'action': "query",
        'format': "json",
        "prop": "pageimages|extracts",
        "pilimit": "max",
        "exsentences": "1",
        "exlimit": "max",
        "exintro": "1",
        "explaintext": "1",
        "generator": "search",
        "gsrsearch": $(".wikiSearch").val()
      },
      type: 'GET',
      headers: {
        'Api-User-Agent': 'Example/1.0'
      },
      success: function(data) {
        console.log("success");
        console.log(JSON.stringify(data));
     },

      error: function(data) {
        console.log("error");
      }
    });
usharya
@usharya
Apr 05 2016 13:13
@DivaWeb I don't know how to use onclick :(
can't it be done with CSS?
Lanitta
@DivaWeb
Apr 05 2016 13:13
@usharya css is a style sheet
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:14
@usharya Not exactly that effect, but you can try doing it by adding :hover to element
@usharya For example you can make a div on top of other with class that hides it in normal state, and on hover it shows it ;)
Lanitta
@DivaWeb
Apr 05 2016 13:15
@usharya https://api.jquery.com/click/ here is a link that may help you
usharya
@usharya
Apr 05 2016 13:15
@mrkaluzny how to do it with the hover?
Lanitta
@DivaWeb
Apr 05 2016 13:16
@usharya yes you can make things change color and do other things with :hover in css but you will not get the dynamic effect you are looking for
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:17
@usharya Check my website for example - http://mrkaluzny.pl (portfolio images are made with CSS)
But there isn’t any dynamic effect ;)
Lanitta
@DivaWeb
Apr 05 2016 13:18
I have to say I fell in love with jquery because it is a shortcut language for using javascript
kirbyedy
@kirbyedy
Apr 05 2016 13:18
@usharya have you checked the source code of that actual page ?
Dylan
@dhcodes
Apr 05 2016 13:19
thanks @sjames1958gm for the tic tac toe help. I'll check it out
CamperBot
@camperbot
Apr 05 2016 13:19
dhcodes sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 443 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
kirbyedy
@kirbyedy
Apr 05 2016 13:20
@usharya you could also try this: https://api.jquery.com/mouseenter/
random-x
@random-x
Apr 05 2016 13:24
@usharya googling helped. I found some CSS that seems to do it. but can't guarantee how compatible it is.
Greg Duncan
@GregatGit
Apr 05 2016 13:25
@mrkaluzny you have an incorrect url so look at this - I made it simpler too
$('document').ready(function() {
  $('#search-input').keypress(function(key) {
    if (key.which == 13) {
      var searchQuery = $('#search-input').val();
      alert(searchQuery);
      //searchQuery = searchQuery.replace(" ", "%20");
      var myApi = 'http://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=';
      myApi += searchQuery;
      myApi += "&callback=?";

      alert(myApi);
      /* Get API data */
      $.getJSON(myApi, function(data) {
        alert("api");
        $('#test').html(JSON.stringify(data));
        alert("success");
      });
    };
  });
});
Lanitta
@DivaWeb
Apr 05 2016 13:25
@usharya if you do use the jquery make sure to include the library for it. You can find it at google libraries and it is just copy and paste
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:26
@GregatGit WOW Thanks! What was wrong with that url?
CamperBot
@camperbot
Apr 05 2016 13:26
mrkaluzny sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:star: 397 | @gregatgit | http://www.freecodecamp.com/gregatgit
Greg Duncan
@GregatGit
Apr 05 2016 13:28
Just compare the old one to the new one - try to keep your varibles simple - so myApi not api + searchValue + cb - doesn't look good
usharya
@usharya
Apr 05 2016 13:28
@DivaWeb Thanks :D I will start learning jquery then hehe
CamperBot
@camperbot
Apr 05 2016 13:28
usharya sends brownie points to @divaweb :sparkles: :thumbsup: :sparkles:
:star: 291 | @divaweb | http://www.freecodecamp.com/divaweb
Islam Ibakaev
@dagman
Apr 05 2016 13:29
almost done with twitch task. What u think? http://codepen.io/dagman/pen/dMZYoM
Dardan Demiri
@dardandemiri
Apr 05 2016 13:30
        var url = "https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&continue=&srsearch="+ inputValue +"&srwhat=text&srprop=timestamp";
        $.getJSON(url, function(json){

            console.log(json);
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:30
@GregatGit thanks again :)
CamperBot
@camperbot
Apr 05 2016 13:30
mrkaluzny sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: mrkaluzny already gave gregatgit points
Dardan Demiri
@dardandemiri
Apr 05 2016 13:30
can someone tell me why do I get this ERROR:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
?
@dagman Looking really good (except for the background color)
Dardan Demiri
@dardandemiri
Apr 05 2016 13:36
@GregatGit still the same error
Greg Duncan
@GregatGit
Apr 05 2016 13:37
@dardandemiri can you put your pen up?
Lanitta
@DivaWeb
Apr 05 2016 13:37
@usharya I think you will like the language and there is a jquery section at Free Code Camp
Dardan Demiri
@dardandemiri
Apr 05 2016 13:37
actually I am working on my PC not in codepen
but wait I read first that article that @kirbyedy gave me
then if it's not working again
I put it on CodePen
Dylan
@dhcodes
Apr 05 2016 13:51
@dardandemiri the why is because the API is preventing abuse, but the mediawiki api should get you results without error if you use the right URL. Cheers!
JD Tadlock
@jdtdesigns
Apr 05 2016 13:55
@dardandemiri You need to return jsonp instead of json
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:56
I have a problem with Wikipedia Viewer. How can I use JSON data to output value of choosen keys?
JD Tadlock
@jdtdesigns
Apr 05 2016 13:58
@mrkaluzny Do you mean output json based on the user input?
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 13:59
@jdtdesigns I have JSON data with user’s input. Now I need it to output only Title of a page and Extract from page to show it to my user
random-x
@random-x
Apr 05 2016 14:00
@mrkaluzny what's your code look like?
Stephen James
@sjames1958gm
Apr 05 2016 14:01
@mrkaluzny If you JSON.stringify the response and dump to the console. You can examine and find the syntax to access the fields you need and insert them into the HTML using jquery of raw html5 js
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 14:01
$('document').ready(function() {
  $('#search-input').keypress(function(key) {
    if (key.which == 13) {
      var searchQuery = $('#search-input').val();

      var API = 'http://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=';
      API += searchQuery;
      API += "&callback=?";

      /* Get API data */
      $.getJSON(API, function(data) {
        var result = data.query.pages;
        $.each(result, function (v,k) {
          var title = v.title;
          var exert = v.extract;

          $('#results').append('<div class="col-sm-12 result">'+'<h3>' + title + "</h3>" + '<p>'+ exert + '</p>');

        })
        $("#test").html(result);

      });
    };
  });
});
@sjames1958gm I did that in previous execrise, and I belive it to be unefficient
JD Tadlock
@jdtdesigns
Apr 05 2016 14:02
@mrkaluzny Have you used the console?
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 14:02
I would like to know the way to do it faster
@jdtdesigns I just did
JD Tadlock
@jdtdesigns
Apr 05 2016 14:03
can you link your codepen?
JD Tadlock
@jdtdesigns
Apr 05 2016 14:05
@mrkaluzny Just looks like you're not accessing the data correctly
api return async which means you have to wait until the data loads before outputting it
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 14:05
I know that, I just don’t know how to access it correctly
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 14:12
So what should I do?
JD Tadlock
@jdtdesigns
Apr 05 2016 14:14
@mrkaluzny I'm working on an example for you
Dardan Demiri
@dardandemiri
Apr 05 2016 14:25
@jdtdesigns have you done the example
Approach it from a functional mindset
Dardan Demiri
@dardandemiri
Apr 05 2016 14:32
@jdtdesigns thanks
CamperBot
@camperbot
Apr 05 2016 14:32
dardandemiri sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:star: 388 | @jdtdesigns | http://www.freecodecamp.com/jdtdesigns
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 14:35
@jdtdesigns Thanks!
CamperBot
@camperbot
Apr 05 2016 14:35
mrkaluzny sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:star: 389 | @jdtdesigns | http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
Apr 05 2016 14:36
@dardandemiri, @mrkaluzny Welcome ;)
Tien Anh Nguyen
@tienanh2007
Apr 05 2016 14:46
does wikipedia search api give out a constant amount of match articles or it is vary with searchword ?
Stephen James
@sjames1958gm
Apr 05 2016 14:46
@tienanh2007 I believe you can tell it a limit, and the default is 10
Tien Anh Nguyen
@tienanh2007
Apr 05 2016 14:47
the problem is my api gives out less article than the example code in freecodecamp build a wikipedia viewer
it is because he use a different api ?
Stephen James
@sjames1958gm
Apr 05 2016 14:50
@tienanh2007 depends on what your search string is possibly
Tien Anh Nguyen
@tienanh2007
Apr 05 2016 14:51
no I believe they are the same string
but the json mine produce give less articles
JD Tadlock
@jdtdesigns
Apr 05 2016 14:52
@tienanh2007 It's based on your search query, not the api
Tien Anh Nguyen
@tienanh2007
Apr 05 2016 14:53
do you mean he didn't use action=query but some other action which produce similar result ?
JD Tadlock
@jdtdesigns
Apr 05 2016 14:56
@tienanh2007 Meaning the parameters he set for the query such as &gsrlimit=10 and such
Tien Anh Nguyen
@tienanh2007
Apr 05 2016 14:57
@jdtdesigns yep I just figure that out. THankyoi
Sephem
@Sephem
Apr 05 2016 15:14
why would the data disapear after it populates?
http://codepen.io/Sephem/pen/EKbbQj?editors=1010
Uğur
@UgurKurt
Apr 05 2016 15:34
Hi guys
Build a Personal Portfolio Webpage
dont you think this project is a little bit overwhelming ?
I mean the tutorials didnt teach anything about it
Stephen James
@sjames1958gm
Apr 05 2016 15:36
@Sephem Check that you are calling event.preventDefault() in your handler
Srinivasan
@kksrini89
Apr 05 2016 15:36
@UgurKurt Giving you a chance to build something for you
Uğur
@UgurKurt
Apr 05 2016 15:36
I know but,the example is too good for me to do
and when it comes to user stories
Jack Of All Trades International.
@JOATI
Apr 05 2016 15:37
It is a plunge in to the deep end but it does give you tools and learns you to ask and search for information when you can't find what you need and if you want to move forward research of information is a must in this field ;)
Uğur
@UgurKurt
Apr 05 2016 15:37
one of them says "I navigate to different sections of the site by clicking buttons."
Jack Of All Trades International.
@JOATI
Apr 05 2016 15:37
just my two cents
Sephem
@Sephem
Apr 05 2016 15:37
@sjames1958gm in which handler?
Uğur
@UgurKurt
Apr 05 2016 15:38
Ok,how can i make users navigate the sites different sections by clicking buttons ?
Stephen James
@sjames1958gm
Apr 05 2016 15:38
@Sephem You have a click handler for the button, yes?
Sephem
@Sephem
Apr 05 2016 15:38
yes @sjames1958gm
Uğur
@UgurKurt
Apr 05 2016 15:39
Oh,no help ? :(
Sephem
@Sephem
Apr 05 2016 15:39
@sjames1958gm wow that worked. can you explain why? Not sure I understand
Ivan
@elementWebDev
Apr 05 2016 15:39
@UgurKurt I found out you don't have to do it just like the example... you just need the basic items, and as you get further you make it more fancy so to speak.
Stephen James
@sjames1958gm
Apr 05 2016 15:40
@Sephem some events have default behavior in the browser, especially submit, what happens is the page reloads unless you do that.
Uğur
@UgurKurt
Apr 05 2016 15:40
yes I know ,but you still have to fulfill user story expectations
Sephem
@Sephem
Apr 05 2016 15:40
@sjames1958gm ahh so the page was being created, but the submit would then reload the page
Uğur
@UgurKurt
Apr 05 2016 15:40
and one of them asks me to make her navigate through the page by clicking buttons
Ivan
@elementWebDev
Apr 05 2016 15:40
@UgurKurt do an about section, portfolio, and contact,
Uğur
@UgurKurt
Apr 05 2016 15:41
yep
Jack Of All Trades International.
@JOATI
Apr 05 2016 15:42
has any of you guys had this "error" in Jquery: reserved word "function"
i've searched but couldn't find zit about it
Srinivasan
@kksrini89
Apr 05 2016 15:43
@JOATI which means you're trying to create the same name which already there in script
Sephem
@Sephem
Apr 05 2016 15:44
@sjames1958gm thanks
CamperBot
@camperbot
Apr 05 2016 15:44
sephem sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Ivan
@elementWebDev
Apr 05 2016 15:44
@UgurKurt i had to start over because i got caught up in the example, then I went back to my map and the link changed... that's when I realized it wasn't so difficult. just do you info first in the html then style as needed
CamperBot
@camperbot
Apr 05 2016 15:44
:star: 450 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Ivan
@elementWebDev
Apr 05 2016 15:46
@UgurKurt i'm still havin a problem with the menu...lol
can someone help with this menu alignment ^
Srinivasan
@kksrini89
Apr 05 2016 15:50
@oghosting use bootstrap navbar
Ivan
@elementWebDev
Apr 05 2016 15:51
@kksrini89 did you look at the code?
Paul Borawski
@iAmNawa
Apr 05 2016 15:51
@oghosting you’r trying to fix the nabber?
you’re nabber*
Ivan
@elementWebDev
Apr 05 2016 15:52
please look at the code before responding
Srinivasan
@kksrini89
Apr 05 2016 15:52
wait. working on that.
Paul Borawski
@iAmNawa
Apr 05 2016 15:52
navbar
Yeah I did, nothing there says menu
Srinivasan
@kksrini89
Apr 05 2016 15:53
@oghosting sure.
cool.
Andrew Charlebois
@andrewchar
Apr 05 2016 15:56
having a hard time figuring out what pictures to put together for my portfolio !! arg
Jack Of All Trades International.
@JOATI
Apr 05 2016 15:57
hahaha yeah it's a hassle
Ivan
@elementWebDev
Apr 05 2016 15:57
it's all over... how about an example of what my menu should look like??
Andrew Charlebois
@andrewchar
Apr 05 2016 15:57
im re-designing my partfolio and putting together all the elements iwant to use
Sephem
@Sephem
Apr 05 2016 15:58
@sjames1958gm I must just say that that one line has fixed more than just the one issue I had. It has fixed a few. Reaslly appreciate it
Lanitta
@DivaWeb
Apr 05 2016 15:59
@andrewchar https://www.pexels.com free stock photos
Andrew Charlebois
@andrewchar
Apr 05 2016 16:00
@DivaWeb yes i use that site and a couple others for pretty good high quality pictures. the problem is what type of pictures i pick to display the feel i want for my version 2 portfolio
Jack Of All Trades International.
@JOATI
Apr 05 2016 16:00

can anyone find out why Jquery is bieng a little B+tch and keeps telling me: "unexpected identifier"...?? : document.get(fn()({})

document.getElementsByTagName("h1")[0].style.fontSize = "120px";

$('#Button_1').click(function() {
$('#output').html(function(i, val) { return val*1+1 });
});

$('#Button_2').click(function() {
  $('#output').html(function(i, val) { return           val*1+1 })
Jacob Sommerville
@JellyKid
Apr 05 2016 16:00
@oghosting I designed my own navbar /w jquery. I just did the layout of my portfolio. I'm almost finished with all of my projects and I'm going to populate after I'm done. https://codepen.io/JellyKid/pen/RaLVmp
Ivan
@elementWebDev
Apr 05 2016 16:01
i have been working on this --^ for over a week, took a break and re-designed but still having a problem with the menu! http://codepen.io/fu11st4ck/pen/QNONgg?editors=1100
--^
Srinivasan
@kksrini89
Apr 05 2016 16:02
@oghosting try this
<nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
  <div class="container">
    <div class="navbar-header"><!-- In Progress - check class positions, nesting, etc. -->
      <a href="http://codepen.io/fu11st4ck/" class="navbar-brand" target="_blank">Ivan Huddleston</a>
      <a class="glyphicon glyphicon-menu-hamburger navbar-toggle" data-toggle="collapse" data-target="#links" role="navigation"></a>
    </div>
   <div id="links" class="collapse navbar-collapse navbar-right">
      <ul class="nav navbar-nav">
        <li><a href="#about">About</a></li>
        <li><a href="#portfolio ">Portfolio</a></li>
        <li><a href="#contact ">Contact</li>
      </ul>
    </div>
  </div>
</nav>
Lanitta
@DivaWeb
Apr 05 2016 16:02
@JellyKid but you don't have the spyscroll effect that the assignment is looking for You should you bootstrap to get the effect
Ivan
@elementWebDev
Apr 05 2016 16:03
@kksrini89 thank you so much!!
CamperBot
@camperbot
Apr 05 2016 16:03
oghosting sends brownie points to @kksrini89 :sparkles: :thumbsup: :sparkles:
:star: 257 | @kksrini89 | http://www.freecodecamp.com/kksrini89
Srinivasan
@kksrini89
Apr 05 2016 16:04
@oghosting you're welcome
Ivan
@elementWebDev
Apr 05 2016 16:04
I will be looking this over to make sure I have it down
Srinivasan
@kksrini89
Apr 05 2016 16:05
@oghosting you forgot to add the jquery library
Jacob Sommerville
@JellyKid
Apr 05 2016 16:05
@DivaWeb Doesn't say anything about spyscroll effect in the user stories...
Lanitta
@DivaWeb
Apr 05 2016 16:05
@oghosting if you are trying to create the scrollspy you need a piece of code added to it
Ivan
@elementWebDev
Apr 05 2016 16:06
scrollspy?
Jack Of All Trades International.
@JOATI
Apr 05 2016 16:06
@kksrini89 Thanks !!
CamperBot
@camperbot
Apr 05 2016 16:06
joati sends brownie points to @kksrini89 :sparkles: :thumbsup: :sparkles:
:star: 258 | @kksrini89 | http://www.freecodecamp.com/kksrini89
Lanitta
@DivaWeb
Apr 05 2016 16:06
@oghosting yes that is what the nav bar for that page is called
Ivan
@elementWebDev
Apr 05 2016 16:08
@kksrini89 ok... I clicked the menu but no links showed
Srinivasan
@kksrini89
Apr 05 2016 16:08
send me the link again
I got to work it
it worked fine.
Lanitta
@DivaWeb
Apr 05 2016 16:09
@oghosting this will need to be put into your body tag <body data-spy="scroll" data-target=".navbar" data-offset="10">
Srinivasan
@kksrini89
Apr 05 2016 16:10
@oghosting you reorder the libraries jquery and bootstrap
since bootstrap depends on jquery.
so first jquery need to be imported then bootstrap.
Ivan
@elementWebDev
Apr 05 2016 16:11
@kksrini89 thank you
CamperBot
@camperbot
Apr 05 2016 16:11
oghosting sends brownie points to @kksrini89 :sparkles: :thumbsup: :sparkles:
:warning: oghosting already gave kksrini89 points
Srinivasan
@kksrini89
Apr 05 2016 16:11
@oghosting worked?
Ivan
@elementWebDev
Apr 05 2016 16:12
yes
@DivaWeb how do I add to the body tag?
Lanitta
@DivaWeb
Apr 05 2016 16:15
@oghosting I know in code pen they don't make you add a body tag to start coding but you should have a body tag around all of you code not the libraries
Ivan
@elementWebDev
Apr 05 2016 16:15
that was very helpful
@DivaWeb thank you
CamperBot
@camperbot
Apr 05 2016 16:15
oghosting sends brownie points to @divaweb :sparkles: :thumbsup: :sparkles:
:star: 292 | @divaweb | http://www.freecodecamp.com/divaweb
Lanitta
@DivaWeb
Apr 05 2016 16:16
@oghosting and don't forget that for every tag you open you must close so make sure you close it after all your code
Ivan
@elementWebDev
Apr 05 2016 16:17
@DivaWeb of course... i did
Stephen James
@sjames1958gm
Apr 05 2016 16:17
@Sephem Glad I could help - ran into that one as well not intuitive
Lanitta
@DivaWeb
Apr 05 2016 16:18
@oghosting cool I just didn't want to forget to tell you something :)
Ivan
@elementWebDev
Apr 05 2016 16:20
@DivaWeb good followthrough
:)
Lanitta
@DivaWeb
Apr 05 2016 16:20
@oghosting but you might need to remove your background color for your links on the right side so you can see the scroll happen as somone moves from one section to the other
Ivan
@elementWebDev
Apr 05 2016 16:22
ok... going to eat then be back to school :) ya'll are saving me lots of frustration @DivaWeb @kksrini89
Lanitta
@DivaWeb
Apr 05 2016 16:22
@oghosting and one more little thing that will help you making a responsive site use % instead of exact pixels
Srinivasan
@kksrini89
Apr 05 2016 16:23
@oghosting yes. absolutely said by @DivaWeb that is relative pixel.
@oghosting have a great day
Ivan
@elementWebDev
Apr 05 2016 16:25
well said
AbdHan
@abdhan
Apr 05 2016 17:32
Hi everyone! Well I was doing the ziplines and I am not able to make any project aesthetically pleasing, although I am able to make the functionality without much help. I feel CSS is too confusing. Placing elements in different places is a headache. Any tips or guideline to be followed in CSS that you would like to share would be quite helpful. TIA. Have a good day.
ehekatlOf
@ehekatlOf
Apr 05 2016 17:32
css related question
if anyone can take a look
how do I responsively change my background height
when I collapse the screen
so the elements don't spill over to the next page?
Jeff
@Jeffgl77
Apr 05 2016 17:35
Us vh instead of %
ehekatlOf
@ehekatlOf
Apr 05 2016 17:36
for my background element?
Jeff
@Jeffgl77
Apr 05 2016 17:38
No, that's my bad. I read to fast
ehekatlOf
@ehekatlOf
Apr 05 2016 17:38
all good dude
Maria Campbell
@interglobalmedia
Apr 05 2016 17:38
@ehekatlOf for background element use min-height.
ehekatlOf
@ehekatlOf
Apr 05 2016 17:38
OOOH
thanks @interglobalmedia
CamperBot
@camperbot
Apr 05 2016 17:38
ehekatlof sends brownie points to @interglobalmedia :sparkles: :thumbsup: :sparkles:
Maria Campbell
@interglobalmedia
Apr 05 2016 17:38
Welcome.
CamperBot
@camperbot
Apr 05 2016 17:39
:star: 265 | @interglobalmedia | http://www.freecodecamp.com/interglobalmedia
ehekatlOf
@ehekatlOf
Apr 05 2016 17:39
what a super cool trick
Maria Campbell
@interglobalmedia
Apr 05 2016 17:39
Will come in handy with thos SPAs @ehekatlOf
ehekatlOf
@ehekatlOf
Apr 05 2016 17:40
I'll keep that in mind, thanks again man
ehekatlOf
@ehekatlOf
Apr 05 2016 17:50
so out of curiosity, why does setting min-height extend the height of the page when compressing it for mobile?
like how does it work?
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 05 2016 17:59
I am working on my twitch status app, however I don't know the sort of response from the api that will be equivalent to an account closed status. Will there be no response at all or there would be an account do not exist response?
Stephen James
@sjames1958gm
Apr 05 2016 18:00
@Itsdenty The response will have an error code 402 or something like that.
ehekatlOf
@ehekatlOf
Apr 05 2016 18:01
yeah
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 05 2016 18:01
Okay, thanks @sjames1958gm
CamperBot
@camperbot
Apr 05 2016 18:01
itsdenty sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 454 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
ehekatlOf
@ehekatlOf
Apr 05 2016 18:02
@Itsdenty look into crossDomain and error
Stephen James
@sjames1958gm
Apr 05 2016 18:03
@ehekatlOf He's talking about a response from twitch when query unknown. {"error":"Unprocessable Entity","message":"Channel 'comster404' is unavailable","status":422} Here is one @Itsdenty
@Itsdenty Remember you can usually put the test url into the browser address bar and get the response
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 05 2016 18:08
Okay James, my only problem is this response would be a string and not a json object, is
Is there a way to create an if statement that would be like if data! == json) do this
greg
@wearenotgroot
Apr 05 2016 18:10
@Itsdenty you will get an object as far as i remember
@Itsdenty you just need to check the status code
Stephen James
@sjames1958gm
Apr 05 2016 18:11
if (response.error) then handle error
@Itsdenty That is json just like your other responses
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 05 2016 18:12
Oh... Okay, since my callback function holds the data variable then if (data.error) do this would work just fine right? @sjames1958gm
Stephen James
@sjames1958gm
Apr 05 2016 18:12
@Itsdenty Yes!
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 05 2016 18:13
On their page only offline n online response json were indexed. Thanks @ehekatlOf
CamperBot
@camperbot
Apr 05 2016 18:13
itsdenty sends brownie points to @ehekatlof :sparkles: :thumbsup: :sparkles:
:star: 242 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 05 2016 18:14
Thanks @sjames1958gm let me go n get my hands dirty then
CamperBot
@camperbot
Apr 05 2016 18:14
itsdenty sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: itsdenty already gave sjames1958gm points
Stephen James
@sjames1958gm
Apr 05 2016 18:16
@Itsdenty :feet:
Achilleas Papakonstantinou
@AchiPapakon
Apr 05 2016 18:22
Why I can't use React on codepen? I selected Babel and react.js
Chris Dziewa
@chrisdziewa
Apr 05 2016 18:36
@AchiPapakon did you include react-dom.js?
Slusherman
@Slusherman
Apr 05 2016 18:37
Stuck on the Spinal Tap Case
Achilleas Papakonstantinou
@AchiPapakon
Apr 05 2016 18:37
@chrisdziewa I did some googling and told me to use React.render instead of ReactDOM.render
Slusherman
@Slusherman
Apr 05 2016 18:38
function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

  var reMore = /([a-z])[\s_]|[]([A-Z])/g;
  newStr = str.replace(reMore, '$1-$2');

  console.log(newStr.toLowerCase());
  return newStr.toLowerCase();
}
spinalCase('thisIsSpinalTap');
Chris Dziewa
@chrisdziewa
Apr 05 2016 18:40
@AchiPapakon React.render is the old way to do it
Achilleas Papakonstantinou
@AchiPapakon
Apr 05 2016 18:40
@chrisdziewa is it deprecated or just old?
Chris Dziewa
@chrisdziewa
Apr 05 2016 18:41
@AchiPapakon I believe it is deprecated. Not 100% sure but it isn't best practice
look under settings and javascript
that's all you need
of course you can use a newer version of React since version 15 is out now but they are very close
Achilleas Papakonstantinou
@AchiPapakon
Apr 05 2016 18:43
@chrisdziewa I'll incluse the dom version, thanks
CamperBot
@camperbot
Apr 05 2016 18:43
achipapakon sends brownie points to @chrisdziewa :sparkles: :thumbsup: :sparkles:
:star: 563 | @chrisdziewa | http://www.freecodecamp.com/chrisdziewa
martina carrington
@MartinaCarrington
Apr 05 2016 18:45
how to do twitch
on twitch it say offine
Chris Dziewa
@chrisdziewa
Apr 05 2016 18:47
This message was deleted
John Liddel
@BreakingOceans
Apr 05 2016 18:55

How does one call a specific version of a font from within a family?
I want to call the Google font Roboto 100 for my <h1>, and then Roboto 400 for my <p>.
I already called in the font-family like this:

<link href='https://fonts.googleapis.com/css?family=Roboto:100,400' rel='stylesheet' type='text/css'>

For some reason all the elements just go to Roboto default?

Jeff
@adzam5
Apr 05 2016 19:12
@BreakingOceans
Just add the font weight you are trying to use to the element in css
h1 {
   font-weight: 100;
}
Michael Karpinski
@karpimpski
Apr 05 2016 19:16
how do I add a downloaded API to my script? I'm trying to use weather-icons-master, but there's no link for it. what should I put in my CSS/JavaScript for the API?
@adzam5 whenever I come on here you're always helping people!
Jeff
@adzam5
Apr 05 2016 19:19
@karpimpski Haha. I try! Helping other people is good practice
@karpimpski You downloaded it to your computer?
Michael Karpinski
@karpimpski
Apr 05 2016 19:19
@adzam5 yeah, I try when I can but I'm not very good yet. yeah, I downloaded Weather Icons to my computer. I'm not sure how I use it with my CodePen
John Liddel
@BreakingOceans
Apr 05 2016 19:19
@adzam5 Ah you are a genius, thank you!!!
CamperBot
@camperbot
Apr 05 2016 19:19
breakingoceans sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 390 | @adzam5 | http://www.freecodecamp.com/adzam5
Michael Karpinski
@karpimpski
Apr 05 2016 19:22
@adzam5 I saw on another project that somebody used default icons from Open Weather. I personally don't like that look, so I'd rather do this. but the only way to use the Weather Icons API is to download it
Jeff
@adzam5
Apr 05 2016 19:22
@karpimpski I still have a lot to learn, but I am always willing to help someone out with something I know how to do or may be able to figure out.
@karpimpski You would have to host the icons publicly somewhere. A lot of people use dropbox or postimg.org
@BreakingOceans Glad I could help!
I used different icons and hosted them at postimg
Michael Karpinski
@karpimpski
Apr 05 2016 19:23
@adzam5 yeah, that does seem like a good way to refresh and improve your skills. could you tell me how to do that? any way I could use google, or would it have to be dropbox?
Jeff
@adzam5
Apr 05 2016 19:25
@karpimpski I'm not sure if google will work. Even using postimg was a pain because each image was given a different URL. I wasn't able to just point to a directory and have the code change the filename
Michael Karpinski
@karpimpski
Apr 05 2016 19:26
@adzam5 hm, well I'm not sure how I'd upload this. I know how to access APIs from online sources, but this is a large file and I think that would be really confusing. I'll keep looking for other ways to use weather icons
Jeff
@adzam5
Apr 05 2016 19:26
@karpimpski I renamed the icons I wanted to use to match the names of the default openweather icons
What type of file is it?
Michael Karpinski
@karpimpski
Apr 05 2016 19:27
@adzam5 it contains a lot of files, varying types
css, eot, svg, ttf, and more
Jeff
@adzam5
Apr 05 2016 19:28
@karpimpski You'd have to link to each file.
Michael Karpinski
@karpimpski
Apr 05 2016 19:29
@adzam5 how would you do what you did? download the icons you want, upload them to the cloud, and store the links in variables in your program?
that seems like that would be the way to go with what you did
Jeff
@adzam5
Apr 05 2016 19:30
@karpimpski Here is my weather app http://codepen.io/adzam5/pen/reBLZR
henrywashere
@henrywashere
Apr 05 2016 19:34
on the "portfolio" section of my webpage, my background image isnt showing up for some reason. whats causing this?
http://codepen.io/henrywashere/pen/XdXxRO
henrywashere
@henrywashere
Apr 05 2016 19:40
ANYONE????
Coy Sanders
@coymeetsworld
Apr 05 2016 19:42
which background image @henrywashere ?
henrywashere
@henrywashere
Apr 05 2016 19:43
on the portfolio section of my webpage
ur suppose to see a pictyure of snowy mountains in thebackgeound
but all i see is a grey background
Michael Karpinski
@karpimpski
Apr 05 2016 19:47
@adzam5 how do you put icons from JavaScript into the HTML?
henrywashere
@henrywashere
Apr 05 2016 19:50
it was working fine yesterday
Jeff
@adzam5
Apr 05 2016 19:50
@karpimpski I did it like this...
$("#icon").html("<img src=" + icon + ">");
Michael Karpinski
@karpimpski
Apr 05 2016 19:53
@adzam5 thanks! just didn't know the syntax for adding images to html from JQ
CamperBot
@camperbot
Apr 05 2016 19:53
karpimpski sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
henrywashere
@henrywashere
Apr 05 2016 19:53
@coymeetsworld do you know whats causing this?
CamperBot
@camperbot
Apr 05 2016 19:54
:star: 391 | @adzam5 | http://www.freecodecamp.com/adzam5
Coy Sanders
@coymeetsworld
Apr 05 2016 19:54
not right away @henrywashere , im actually heading to lunch going to be back in an hour
henrywashere
@henrywashere
Apr 05 2016 19:54
gotcha
Coy Sanders
@coymeetsworld
Apr 05 2016 19:54
i was able to get to the jpg although photobucket redirected me to html
ill take a look when i get back if you haven't figured it out by then, just let me know in an hour
henrywashere
@henrywashere
Apr 05 2016 19:55
awesomoe thanks
Jeff
@adzam5
Apr 05 2016 19:56
@henrywashere You said it was working yesterday. Did you make any changes to other parts of your code since then?
@karpimpski No problem!
henrywashere
@henrywashere
Apr 05 2016 19:56
i made one change today
i deleted my profile picture
thats all i did
is codepen buggin out or something? lol
DanielCornea
@DanielCornea
Apr 05 2016 20:00
@henrywashere works fine for me
Mike Olo
@michaelolo24
Apr 05 2016 20:01
Can anyone help me figure out why I'm unable to print the JSON for the weather app?
Here's my codepen:
henrywashere
@henrywashere
Apr 05 2016 20:01
really? i still see a grey background :(
Andrew Schmidthuber
@calicode
Apr 05 2016 20:04
@henrywashere try moving it to something like postimage and see if it works
i had similar issues with my portfolio and imgur
Michael Karpinski
@karpimpski
Apr 05 2016 20:04
how do I make a function that toggles true and false? I want to make my temperature icon have a JQ function that chnges it from F to C and the other way around
Mike Olo
@michaelolo24
Apr 05 2016 20:05
all im trying to do is print out the json to make sure it's being received, but nothing is exporting...is this an issue with codepen or is my code messed up?
henrywashere
@henrywashere
Apr 05 2016 20:05
thanks ill try taht out
Michael Karpinski
@karpimpski
Apr 05 2016 20:08
@adzam5 not sure if you can help more, but how do I make a variable global? I know how to do it normally, but for some reason when I place a var outside of all of my functions, I can't access it in the rest of my functions, even though I should be able to
henrywashere
@henrywashere
Apr 05 2016 20:09
aaaargh, it didnt work lol
Jeff
@adzam5
Apr 05 2016 20:11
@karpimpski var myVariable = variable;
@karpimpski Are the functions within a .getJSON?
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 20:13
@karpimpski You make a variable global by declaring it like that -> 'myVariable = "myString";' or declaring it outside of function (you can leave it empty) by doing that 'var myVariable;'
Michael Karpinski
@karpimpski
Apr 05 2016 20:13
@adzam5 I'm declaring them like that outside of all of my functions, and no. I'm just using them like normal functions
normal JS functions I mean
@mrkaluzny thanks! I know how to make them global normally, I think JSON is just making it weird and I'm not sure how to do it with this program
CamperBot
@camperbot
Apr 05 2016 20:14
karpimpski sends brownie points to @mrkaluzny :sparkles: :thumbsup: :sparkles:
:star: 285 | @mrkaluzny | http://www.freecodecamp.com/mrkaluzny
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 20:14
@karpimpski Can you simply link your pen? I’ll take a look at it
Michael Karpinski
@karpimpski
Apr 05 2016 20:15
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 20:15
I did it by toogling F and C by changing it value on toggle ;)
Michael Karpinski
@karpimpski
Apr 05 2016 20:15
I want to make functions for the temperature and a JQuery function to change from F to C, among other functions
@mrkaluzny
Stephen James
@sjames1958gm
Apr 05 2016 20:16
@karpimpski You can actually request the data in the desired units
Joshua Abu
@Absolutestunna
Apr 05 2016 20:19
I'm looking for a very good css framework or library that I can get stylish forms, buttons, inputs e.t.c. I was using mdboostrap and I think their site crashed. I didn't get the chance to download a local version for my project. I don't want to use regular bootstrap. Any suggestions??
EternityElephant
@EternityElephant
Apr 05 2016 20:22

http://codepen.io/Lewis17/pen/EKbLag

I cant seem to get Math.round working in my javascript, could someone take a look

1ety
@1ety
Apr 05 2016 20:23
were to learn about how to add scrolling to the page?
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 20:23
@karpimpski http://codepen.io/mrkaluzny/pen/grXKaO?editors=0011 Check out this one :)
Added clicking functionality, and corrected your function :)
Brandon
@Daxo
Apr 05 2016 20:24
Hey everyone, I'm having some issues getting the twitter href to change on click. Can someone take a look please? Any help would be appriciated http://codepen.io/apeiron/pen/bpYwob
Jeff
@adzam5
Apr 05 2016 20:25
@Absolutestunna I have never used it, but http://www.materializecss.com seems similar to bootstrap, but fancier
Wojciech Kałużny
@mrkaluzny
Apr 05 2016 20:25
@karpimpski But the better solution is to change data on clicking by re counting it (you don’t reload the page)
Brandon
@Daxo
Apr 05 2016 20:25
specifically, this function doesn't seem to be working:
//twitter button
        var replacementUrl = "";
        $('#twitter-button').attr('href', (function() {

            replacementUrl = "http://google.com"; //https://twitter.com/intent/tweet?text=test
            return this.replace(replacementUrl);
          }

        ));
Stephen James
@sjames1958gm
Apr 05 2016 20:25
@EternityElephant It looks like you are using Math.round on farenheit and displaying celsius.
@EternityElephant Add units=imperial or units=metric to your request URL and you can get the appropriate unit returned.
Joshua Abu
@Absolutestunna
Apr 05 2016 20:27
@adzam5 Thank you. Thats what i'm looking for. I never got to check it out.
CamperBot
@camperbot
Apr 05 2016 20:27
absolutestunna sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 392 | @adzam5 | http://www.freecodecamp.com/adzam5
1ety
@1ety
Apr 05 2016 20:27
How to access all of the portfolio webpage's content just by scrolling?
Michael Karpinski
@karpimpski
Apr 05 2016 20:29
@mrkaluzny that toggle button doesn't change my F to C, and I want the toggle to BE the F or the C, using an <a> tag
Paul Borawski
@iAmNawa
Apr 05 2016 20:35
How do you make the photos on your site a smaller size without reducing image quality?
Tim Signore
@Timsig
Apr 05 2016 20:40

@bleafman , I'm not sure why you need the alternative URL. Think you just need to inject the current quote text and citation into the href of the twitter button

$('#twitterLink').attr({
    'href': 'https://twitter.com/intent/tweet?hashtags=timsig,quotemachine&amp;related=freecodecamp&amp;text=' + post.content + ' - ' + post.custom_meta.Source,
    target: 'blank'
  });

or something along those lines?

I want to make my degree part so that it changes from F to C every time I click it. how can I do that?
Jasmina Babic
@animsaj
Apr 05 2016 20:49
@iAmNawa you can reduce image size. there are many online free services to do that. it is for the files hosted by you not for the linked files, of course
Tim Signore
@Timsig
Apr 05 2016 20:49
@karpimpski , place the section you have marked as print temperature in a function (changeTempUnits), every time a click is received, change your variable tempType from F to C (or vice versa) and call changeTempUnits
Stephen James
@sjames1958gm
Apr 05 2016 20:50
@karpimpski You can attach a click handler to you <p> for the temperature and do what @Timsig says :)
Michael Karpinski
@karpimpski
Apr 05 2016 20:50
@Timsig I've tried making functions, but I can't make global variables for some reason. I think it has something to do with JSON, but when I make a global variable I still can't access it in other functions
@sjames1958gm by click handler do you mean a JQ click() function? I did that, but I can't call any functions because of what I said above
Jasmina Babic
@animsaj
Apr 05 2016 20:51
@iAmNawa I used smush.it
Stephen James
@sjames1958gm
Apr 05 2016 20:53
@karpimpski put your temp inside another element - doesn't have to be a <a> tag probably a <span> with an id you can reference in jquery
Tim Signore
@Timsig
Apr 05 2016 20:53
@karpimpski , tempType is not global, as you've declared it inside your getJSON function; declare it at the top (where you have var long and lat, and then assign it's value within the function
Michael Karpinski
@karpimpski
Apr 05 2016 20:54
@Timsig okay, I'll try that and let you know how it turns out. how would I make something global with this program, though? I'm guessing my variables can't be global because they are connected with the API, but I don't know how to fix that
@Timsig actually, I'm confused. should I make a function called tempType and pass it a variable, changing it whenever I click the temp?
Tim Signore
@Timsig
Apr 05 2016 20:57
your varables are global to your application, as long as you declare them at the top. Inside the document.ready function, but outside all your other functions, just as you have declared longitude and latitude
Michael Karpinski
@karpimpski
Apr 05 2016 20:57
whenever I put a variable at the top with long and lat it doesn't work anywhere in my code, it doesn't make it global (or in this case, able to be used anywhere in the onload function).
@Timsig my variables aren't global, not the ones with the API at least. I can't make them global, I can't use them anywhere if I declare them at the top
@Timsig nevermind, it works with tempType. but my function doesn't work. here's a snippet of my code:
$('#temperature').click(function(){
if(tempType == "F"){
tempType = "C";
$('#temperature').html(celsius + "&deg" + tempType);
}
if(tempType == "C"){
tempType = "F";
$('#temperature').html(farenheit + "&deg" + tempType);
}
});
if I take out the second if statement, it works
nevermind, just made it an else if. now, sorry about having so many questions, but is there a way I could make that a button so the mouse isn't a cursor when I hover?
Tim Signore
@Timsig
Apr 05 2016 21:03
@karpimpski ,OK i think i see your problem - all your code is wrapped in the success function of the get JSON, which is why you can't access the variables. I would look at restructuring the code so that the callback function passes the data to the other functions
$.getJSON(openWeather, function(data) { updateView(data)}
ehekatlOf
@ehekatlOf
Apr 05 2016 21:04
anybody have a resource like FA with all the web developer icons in one place?
like font awesome seems to be missing big ones like jquery, bootstrap
Michael Karpinski
@karpimpski
Apr 05 2016 21:04
@Timsig I have no idea how I would do that. I'm sorry, I'm not very good with JSON. I'm really bad with it, actually
ehekatlOf
@ehekatlOf
Apr 05 2016 21:04
even javascript
the other alternative would be to just get the logos and set manual dimensions
but I'd rather have something standardized
Tim Signore
@Timsig
Apr 05 2016 21:06
where updateView is a function containing all your code that updates the html page with the received data
ehekatlOf
@ehekatlOf
Apr 05 2016 21:07
you're the best @animsaj <3
@animsaj thanks
CamperBot
@camperbot
Apr 05 2016 21:07
ehekatlof sends brownie points to @animsaj :sparkles: :thumbsup: :sparkles:
:star: 470 | @animsaj | http://www.freecodecamp.com/animsaj
Michael Karpinski
@karpimpski
Apr 05 2016 21:08
@Timsig whenever I try to move my code away from the JSON function, none of the variables work
wrong link. here's the right one: http://codepen.io/karpimpski/pen/JXOLyY?editors=1010
Tim Signore
@Timsig
Apr 05 2016 21:19
@karpimpski - sorry I don't know what else to suggest
Michael Karpinski
@karpimpski
Apr 05 2016 21:19
@Timsig I just need to know what you meant by getting my code out of get JSON
and how you do it, if you could tell me
Tien Anh Nguyen
@tienanh2007
Apr 05 2016 21:20
how do I make my wiki page give suggestion when a string is being type like what google does
Tim Signore
@Timsig
Apr 05 2016 21:23

@karpimpski Declare a variable at the top of your code:

var currentWeather = {};

then, your get JSON can look like this, and all other code can refer to currentWeather and be outside of the getJSON calback function

$.getJSON(openWeather, function(data) {
currentWeather = data;
}
Michael Karpinski
@karpimpski
Apr 05 2016 21:25
@Timsig I have no idea what you mean by "refer to currentWeather" and how I would make that work, since I've already written a lot of my code. I guess I'm just no good at this. I'll try to figure it out if you can't help me any more
Stephen James
@sjames1958gm
Apr 05 2016 21:30
refer to means use
Jason Wilcox
@DenverRenGuy
Apr 05 2016 21:31
@karpimpski it reads like the suggestion is saying declare your variable outside of the callback function so you can use it across the entire scope of your javascript code
Michael Karpinski
@karpimpski
Apr 05 2016 21:31
@sjames1958gm I know what refer to means, I should've been more clear. I just don't know how I would do what he said
Stephen James
@sjames1958gm
Apr 05 2016 21:32
In your click function use currentWeather just like you do with data in fromJSON function.
Michael Karpinski
@karpimpski
Apr 05 2016 21:33
@sjames1958gm okay, but what he suggested is taking most of my code out of my getJSON function. I want to do that, I just don't know how, especially since I've written all this code already
Jason Wilcox
@DenverRenGuy
Apr 05 2016 21:34
does anyone have a favorite resource for Content Security Policy directive ...stuff, I am seeing this error when I try to call the twitter functionality for random quotes
Paul Borawski
@iAmNawa
Apr 05 2016 21:44
@animsaj thanks!
CamperBot
@camperbot
Apr 05 2016 21:44
iamnawa sends brownie points to @animsaj :sparkles: :thumbsup: :sparkles:
:star: 471 | @animsaj | http://www.freecodecamp.com/animsaj
Jason Wilcox
@DenverRenGuy
Apr 05 2016 21:49
anyone want to tackle a disabled button/ enabled button oddity
?
Brandon
@Daxo
Apr 05 2016 21:53
@Timsig thanks for the help!
CamperBot
@camperbot
Apr 05 2016 21:53
bleafman sends brownie points to @timsig :sparkles: :thumbsup: :sparkles:
:star: 287 | @timsig | http://www.freecodecamp.com/timsig
Michael Karpinski
@karpimpski
Apr 05 2016 21:53
how can I get good-looking images for the weather app? I've tried a few APIs but they're all downloadable and I can't figure out how to use those, or find any that have links
Brandon
@Daxo
Apr 05 2016 21:54
@Timsig Now I just need a better quote API because that one includes a whole bunch of HTML in the content ><
Jason Wilcox
@DenverRenGuy
Apr 05 2016 21:55
@bleafman I had a similar problem I just solved, jquery text() function
run your content through the text function and it will clean up the html components
Stephen James
@sjames1958gm
Apr 05 2016 21:58
@karpimpski Rewriting and refactoring code is going to be part of adapting to different needs.
Michael Karpinski
@karpimpski
Apr 05 2016 22:00
@sjames1958gm I know, I just don't know where to start with it and I'm trying to get some help to get started, since FCC doesn't provide much explanation
Jason Wilcox
@DenverRenGuy
Apr 05 2016 22:05
Michael Karpinski
@karpimpski
Apr 05 2016 22:05
@sjames1958gm I'm done programming for the night. you seem much more experienced than me, so it would be great if you could e-mail me (mike.karpinski99@gmail.com) any tips, or even example code to help me out a little. that would be really great, but if you don't, I understand that you have other things to do
Stephen James
@sjames1958gm
Apr 05 2016 22:05
@karpimpski Good night sir
Michael Karpinski
@karpimpski
Apr 05 2016 22:06
@sjames1958gm 'night. thanks for the help, even though, most of your advice is lost on me, at least for now
CamperBot
@camperbot
Apr 05 2016 22:06
karpimpski sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 458 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Michael Karpinski
@karpimpski
Apr 05 2016 22:06
oops, didn't mean that comma after "though"
Jose Barakat
@JoseBarakat
Apr 05 2016 22:12

@kazan221 @ChadKreutzer , my code doesn't work in three cases

function checkCashRegister(price, cash, cid) {

  //First, find out how many cid (cash-in-drawer) we have,
  //so we have to convert the info inside the 2D array into a number.
  var change = [], //Initialize array for array change storing. 
      totalCid = 0, //Initialize numeric value of cash-in-drawer.
      changeDue = (cash - price).toFixed(2), //Pending change in numbers.
      cnb = [0.01, 0.05, 0.10, 0.25, 1, 5, 10, 20, 100]; //Numeric representation of coins and bills.


  //Total amount of cash in drawer befor giving change  
  for (var i = 0; i < cid.length; i++) {
    totalCid += cid[i][1];
  }


  //If cash-in-drawer is less than change due, then we don't have enough money 
  if (totalCid < changeDue) {
    //Return the string "Insufficient Funds"
    return "Insufficient Funds";

  } else 
    // if cash-in-drawer is equal to the change due,
    if (totalCid == changeDue) {
      //then we just ran out of money.
      return "Closed";

      //If (totalCid > pendChange), it means we have enough money for change.
    } else {
      //return change in coins and bills, sorted in highest to lowest order.
      //This for loop will examine the cid array backwards.

      //Only in this exercise, we will have to loop 8 (cid.length - 1) times.
      for (var j = 8; j >= 0; j--) {

        //pendChange <= cid[j][1] checks if we have enough amounts of bills/coins
        //Number.isInteger(pendChange/cnb[j]) checks if amount of bills coins is integer
        if (changeDue <= cid[j][1] && Number.isInteger(changeDue/cnb[j]) ) {


            //Unshift this array [currency, numeric value of change] for index j
            change.unshift( [cid[j][0], changeDue] );
            changeDue = cid[j][1] - changeDue;

        } else 
          //Same thing as before but this time If pendChange > cid[j][1]
          if (cid[j][1] !== 0 && changeDue > cid[j][1] ) {
            //[currency, numeric value of change] for index j
            change.unshift([cid[j][0], Math.floor(changeDue/cnb[j])]);

            //Now that this cycle has finished, the new value of the pending change
            //is the integer value of the remains of pendChange / cnb[j]. We're gonna
            //be working with this value on the next cycle of the loop.
            changeDue = changeDue%cnb[j];
          }
          //End of else if
      }
      //End of for Loop

    //This is a 2D array of the exact change when there is enough cash in drawer.
    return change;
  }
  //End of else if

// Here is your change, ma'am.
}

And it doesn't work in this cases:

 checkCashRegister(19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]); 
//should return [["QUARTER", 0.50]].

checkCashRegister(3.26, 100.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);  
//should return [["TWENTY", 60.00], ["TEN", 20.00], ["FIVE", 15], ["ONE", 1], ["QUARTER", 0.50], ["DIME", 0.20], ["PENNY", 0.04]].

checkCashRegister(19.50, 20.00, [["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1.00], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]) 
//should return "Insufficient Funds".
Jasmina Babic
@animsaj
Apr 05 2016 22:17
@DenverRenGuy disabled="disabled" and then in your js only this: $('#tweetIt').removeAttr("disabled"); in the place of your other code dealing with disabled attribute + remove function at the end of code dealing again with disabled
@DenverRenGuy complete code that makes your tweet button enables when you get a quote: ```

$(document).ready(function() {
var quoteUrl = "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=?";
var currentQuote = "";
var currentAuthor = "";
$("#getQuote").on("click", function(e) {
e.preventDefault();
$.getJSON(quoteUrl,
function(data) {
console.log(data);
$('.quote-content').html(data[0].content);
$('.quote-title').html("~ " + data[0].title);
currentQuote = $(data[0].content).text();
currentAuthor = data[0].title;

    $('#tweetIt').removeAttr("disabled");
  });
$("#tweetIt").on("click", function(e) {
  e.preventDefault();
  window.open('https://twitter.com/intent/tweet?hashtags=randomquote&related=freecodecampe&text=' + encodeURIComponent('"' + currentQuote + '"' + "~ " + currentAuthor));
});

});
});

Jasmina Babic
@animsaj
Apr 05 2016 22:27
@DenverRenGuy something else: move your window.open part outside of the function for getting quote, otherwise you'll get 2 windows opem
@DenverRenGuy open
Screenshot from 2016-04-06 01:28:34.png
brenjamin
@brenjamin
Apr 05 2016 22:32
@brenjamin
Hey all.. just started work on my portfolio page. I'm building a navbar at the top of the page, but I can't seem to get the nav-pills to work. Using <ul class="nav nav-pills navbar-nav navbar-right"> ... </ul>
But it just looks like unformatted text..
Stephen James
@sjames1958gm
Apr 05 2016 22:32
@JoseBarakat Your checking for insufficient funds doesn't work when the change is $.50 and all that is in there is $1 and $.01 - confused about that if, if the cid is greater than the changeDue shouldn't you move to the next value?
Jasmina Babic
@animsaj
Apr 05 2016 22:41
@brenjamin you have good example here: http://jsfiddle.net/3e98f/
Jose Barakat
@JoseBarakat
Apr 05 2016 22:47
Thanks @sjames1958gm , will check that and come back
CamperBot
@camperbot
Apr 05 2016 22:47
josebarakat sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 459 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
AbdHan
@abdhan
Apr 05 2016 22:55
@brenjamin i think navbar and nav nav-pills are different. More here: getbootstrap.com/components#navbar
henrywashere
@henrywashere
Apr 05 2016 23:09
can anyone here help out here please? on the portfolio section of my webpage, my background image isnt showing up
all i see is a grey background
nsloc22
@nsloc22
Apr 05 2016 23:14
@brenjamin <a> tags need to be put inside of <li> tags when using pills, try this
 <ul class="nav nav-pills navbar-right">
   <li class="active"><a href="#">Home</a></li>
   <li><a href="#">About</a></li>
   <li><a href="#">Portfolio</a></li>
   <li><a href="#">Contact</a></li>
</ul>
Lanitta
@DivaWeb
Apr 05 2016 23:15
@henrywashere it looks like you have the color gray in your css for the body tag
henrywashere
@henrywashere
Apr 05 2016 23:20
i know that, but why isnt the image i placed showing up??
Dylan
@dhcodes
Apr 05 2016 23:24
@henrywashere it's because photobucket reroutes the image i believe
@henrywashere if you enter it in the URL you'll see what I mean
nsloc22
@nsloc22
Apr 05 2016 23:25
@henrywashere for start you are missing a semicolon after url for porfolio css
Dominic Lobban
@alkapwn3d
Apr 05 2016 23:26
check out my awesome calculator
http://kanvas.myartsonline.com/
too bad i dont know how to make it work lol
Dylan
@dhcodes
Apr 05 2016 23:27
@henrywashere nvm. What I said was wrong
StasiekK
@StasiekK
Apr 05 2016 23:27
OK guys, after 2 weeks of not doing portfolio project i finished it, need help (english grammar), esthetic, and code. All feedback welcome!!!
http://codepen.io/StasiekK/full/zqZmOx/
henrywashere
@henrywashere
Apr 05 2016 23:27
@dhcodes the picture showed up yesterday
so i dont know whatthe problem is
@nsloc22 added a semicolon...didnt work
EternityElephant
@EternityElephant
Apr 05 2016 23:30
Hye guys i was wondering if someone coud take a look at my Weather App. I can't seem to figure out how to get the temperature to change. The button works and everything but the value itself doesnt
S.L. Ting
@palden
Apr 05 2016 23:30
@palden
Dylan
@dhcodes
Apr 05 2016 23:33
@henrywashere it could be something simple like a missed closing tag or ; ... you have a few of those
EternityElephant
@EternityElephant
Apr 05 2016 23:35
yeah if anyone has a suggestion let me know im a bit stumped
nsloc22
@nsloc22
Apr 05 2016 23:38
@henrywashere it the </div> tag somewhere missing or extra, your contact section is inside portfolio div
henrywashere
@henrywashere
Apr 05 2016 23:42
i dont get it