These are chat archives for FreeCodeCamp/HelpFrontEnd

11th
Feb 2016
Amir Ghafouri
@amirghafouri
Feb 11 2016 00:02

It works now!

For anyone who's curious, I changed this:

$("#reduceWork").on("click", function() {
  var workLength = $("#workLength").text(); 
  $("#workLength").text(workLength - 1);
});

to this:

$("#reduceWork").on("click", function() {
  workSeconds = workSeconds - 1;
  workTimerSeconds = workSeconds;
  countDown = workTimerSeconds;
  var workLength = $("#workLength").text(); 
  $("#workLength").text(workTimerSeconds);
});

WTF it was literally just working perfectly and now it's glitching out and showing a bunch of 1s and NaN... I didn't touch anything!!

http://codepen.io/amirghafouri/pen/MKPvRa/?editors=1010

Amir Ghafouri
@amirghafouri
Feb 11 2016 00:08

SO BIZARRE:
if you click the minus button for work length first, and then the plus sign, both work perfectly fine.
if you click the plus button for work length first, it adds 1s to the end, and then when you click the minus sign it goes to NaN

???

Omar Richardson
@omie86
Feb 11 2016 00:46
Can someone explain to me how the .parent() selector works for $ ?
Purna Kanneganti
@purnakanneganti
Feb 11 2016 01:13

@purnakanneganti
var Bike = function() {

// Only change code below this line.
var gear = 1;

this.setGear = function(change){
gear += change;
};
this.getGear = function() {
return gear;
};
};
did anyone got this challenge

Joshua Bernstein
@jberns
Feb 11 2016 01:42
@amirghafouri if you are still stuck. When you are reading the "7" it is getting assigned as a string. It appears when you subtract from the string the javascript is automatically converting it to a number, but in javascript you can use the plus sign to concatenate strings so it is doing "7" + " 1" = "7 1" as a string which is why you are getting the not a number (NaN) error.
when you get the worktime you can parse it as an int to make sure it starts as a number var workSeconds = parseInt($("#workLength").text());
Loren Baca
@vbroskas
Feb 11 2016 03:07
it's not possible to have more than one <body></body> element per page is there?
Im trying to figure out how to add multiple background images to a page
seems like you should be able to add different background images to different <div> but I havent figured out how to do it
bitgrower
@bitgrower
Feb 11 2016 03:55
good question ... not sure ... @vbroskas the ultimate answer is in the w3c docs ... :)
DJ
@qualitymanifest
Feb 11 2016 04:17
@vbroskas just add the background images to divs
bitgrower
@bitgrower
Feb 11 2016 04:19
LOL @qualitymanifest -- leave it to me to get caught up in the first question and not read on ...
Ingrid
@voodoobettie
Feb 11 2016 04:23
@vbroskas Do you mean different background images that rotate, or more as your scroll down?
h4r1m4u
@h4r1m4u
Feb 11 2016 06:17
@vbroskas no, you cannot have multiple body elements in the same page. you can add different background images to other elements, though, like divs. give each of your divs either a unique class or id and in your CSS create the relevant style for the class or id with the background image you want
Eugene Ilyushin
@Ilyushin
Feb 11 2016 06:39
Hi everyone! I have a problem with "Exact Change" (Advanced Algorithm Scripting). There is a test "drawer(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”". How is it possible? We have 1.01 in cid and change equals 0.50.
Salman Shahid
@salman-shahid
Feb 11 2016 06:47
Just finished my calculator. https://jsfiddle.net/himynameissal/j42p5f4z/embedded/result/ Can anyone find any bugs?
Dulshani Gunawardhana
@dshgna
Feb 11 2016 06:59
@mynameissal: loading time is pretty slow
Salman Shahid
@salman-shahid
Feb 11 2016 07:00
It's probably because of the background image..
I think I will remove it
h4r1m4u
@h4r1m4u
Feb 11 2016 07:00
@mynameissal yup. a) i'm unable to use two decimals, e.g. 0.5 + 0.6. b) i can press operators multiple times in which case the result is not evaluated, e.g. 3 ++ 6. c) the % button doesn't seem to do anything
@mynameissal from the usability point of view, i'm missing some sort of buttons. when i hover my cursor over the number, it changes to a text selection cursor, not into a pointer cursor.
Salman Shahid
@salman-shahid
Feb 11 2016 07:02
@h4r1m4u Thanks, I just noticed error (a), error (b) I thought I handled it but I will try to find a fix. % button works it should give remainder e.g. 25 % 5 = 0
CamperBot
@camperbot
Feb 11 2016 07:02
mynameissal sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1389 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 11 2016 07:02
@mynameissal oh, it's a modulo, not percentage. i see
that's confusing as usually calculators use that for percentages
Salman Shahid
@salman-shahid
Feb 11 2016 07:03
Yep, I noticed that to even though the divs are assigned the role button..
I will change the text
Salman Shahid
@salman-shahid
Feb 11 2016 07:23
Why does parseInt("%") == NaN return false? https://repl.it/Blm1/1
kirbyedy
@kirbyedy
Feb 11 2016 07:26
is it a number ?
Salman Shahid
@salman-shahid
Feb 11 2016 07:26
parseInt("%") should return NaN
kirbyedy
@kirbyedy
Feb 11 2016 07:29
hmm
Salman Shahid
@salman-shahid
Feb 11 2016 07:29
Someone in another chat said I have to use:
isNaN(parseInt("%")) // => true
kirbyedy
@kirbyedy
Feb 11 2016 07:30
I tried it on w3 school and returns Nan
NaN
changed number 10 to %, and it gave me NaN
Salman Shahid
@salman-shahid
Feb 11 2016 07:32
parseInt(10) returns 10
Salman Shahid
@salman-shahid
Feb 11 2016 07:37

All errors fixed. Let me know what you guys think:

https://jsfiddle.net/himynameissal/j42p5f4z/4/embedded/result/

Thanks!

kirbyedy
@kirbyedy
Feb 11 2016 07:41
@mynameissal works :thumbsup:
Russell Smith
@rjsmith25
Feb 11 2016 10:37
Salman Shahid
@salman-shahid
Feb 11 2016 10:53
@rjsmith25 Is this a FCC challenge or is this a personal project?>
Russell Smith
@rjsmith25
Feb 11 2016 10:56
fcc challenege
Salman Shahid
@salman-shahid
Feb 11 2016 10:57
Which one?
kirbyedy
@kirbyedy
Feb 11 2016 10:58
voting app in the backend section
sigursiguros
@sigursiguros
Feb 11 2016 12:14
Can anyone help explain the below algorithm? I've been studying it for a while, still not getting the logic.

function diff(arr1, arr2) {
var newArr = [];

var onlyInArr1 = arr1.filter(function(current1){
return arr2.filter(function(current2){
return current2 === current1
}).length == 0;
});

var onlyInArr2 = arr2.filter(function(current2){
return arr1.filter(function(current1){
return current1 === current2
}).length == 0;
});

newArr = onlyInArr1.concat(onlyInArr2);
return newArr;
}

Marius Brad
@mbrad26
Feb 11 2016 12:31
hello world
CamperBot
@camperbot
Feb 11 2016 12:31

welcome to FreeCodeCamp @mbrad26!

sigursiguros
@sigursiguros
Feb 11 2016 12:31
function diff(arr1, arr2) {
  var newArr = [];

  var onlyInArr1 = arr1.filter(function(current1){
    return arr2.filter(function(current2){
      return current2 === current1
    }).length == 0;
  });

  var onlyInArr2 = arr2.filter(function(current2){
    return arr1.filter(function(current1){
      return current1 === current2
    }).length == 0;
  });

  newArr = onlyInArr1.concat(onlyInArr2);
  return newArr;
}
Marius Brad
@mbrad26
Feb 11 2016 12:32
Could someone pls have a look over my code. When I'm pressing the generate quote button nothing is happening. Thanks
Marius Brad
@mbrad26
Feb 11 2016 12:43
Anyone?
Salman Shahid
@salman-shahid
Feb 11 2016 12:49
@mbrad26 You're missing a randomising index function
When you click your generate button it's returning the same quote that was set at load
Marius Brad
@mbrad26
Feb 11 2016 12:50
Oh...thanks...I'll dig deeper:)
Salman Shahid
@salman-shahid
Feb 11 2016 12:50
Nevermind..
I'm not sure what's wrong I'll have a look I just realised you randomise your index when set the index.
Marius Brad
@mbrad26
Feb 11 2016 12:52
ok
Yes I did that.
Thomas
@Motass
Feb 11 2016 12:52
@mbrad26 your function returns the quote, so the click(generateQuote) doesn't do anything
Add the $("h2").text( <your quote>); in the generateQuote function
Marius Brad
@mbrad26
Feb 11 2016 12:54
But it should generate the quote on click/
Thomas
@Motass
Feb 11 2016 12:54
and call it in document.ready
Salman Shahid
@salman-shahid
Feb 11 2016 12:54
No @Motass
Marius Brad
@mbrad26
Feb 11 2016 12:54
ok..I'll give it a try
Salman Shahid
@salman-shahid
Feb 11 2016 12:54
He is calling his generate quote function only when the document is ready.
@mbrad26 You need to create a function to generate a quote and call it when clicked outside of your ready function.
Your on click function inside your on ready will never be called.
You can realise your on click function and how you were generating your quote before in your ready function with a call to the new function that you define outside of your on doc ready function.
Thomas
@Motass
Feb 11 2016 12:56
He is calling his quote function on click: $(".quote").click(generateQuote)
Either do $(".quote").click(function() {
$("h2").text(generateQuote);
}); or add the h2 update in your generateQuote function
Marius Brad
@mbrad26
Feb 11 2016 12:59
OK guys...gest a sec
OK guys just a sec.
Salman Shahid
@salman-shahid
Feb 11 2016 13:01
What I wrote makes no sense...I can't even back track and correct it!
Christian Kumala
@Code21k
Feb 11 2016 13:03
guys, can help me??
i want my background-image's size inherent div'size
but i tried some css but its still faile
Thomas
@Motass
Feb 11 2016 13:04
@mbrad26 also put your index var in the generateQuote function so it's generated everytime you click
Salman Shahid
@salman-shahid
Feb 11 2016 13:07
He doesn't have a generateQuote function it's a variable
Thomas
@Motass
Feb 11 2016 13:10
A function can be stored in a variable in javascript, that's the case here
var generateQuote = function()
Salman Shahid
@salman-shahid
Feb 11 2016 13:11
Oh..so each time he checks the variable it will execute the function?
Marius Brad
@mbrad26
Feb 11 2016 13:14
Nope...I don't know what I'm doing...is not working.
Thomas
@Motass
Feb 11 2016 13:14
If he calls it, yes generateQuote()
Marius Brad
@mbrad26
Feb 11 2016 13:15
I did this:
var generateQuote = function() { return $("h2").text(quoteArr[index]["quote"]).css(style); };
is this a valid variable?
Thomas
@Motass
Feb 11 2016 13:15
No, you shouldn't return that
Either return the quote or change the h2 tag but not both
Do this : var generateQuote = function() {
var index = Math.floor(Math.random() * quoteArr.length);
return quoteArr[index]["quote"];
};
That returns a random quote each time you call the function
Marius Brad
@mbrad26
Feb 11 2016 13:17
but I already var index outside the function
Thomas
@Motass
Feb 11 2016 13:17
Then in document ready: $(".quote").click(function() {
$("h2").text(generateQuote).css(style);
});
$(".quote").click(function() {
$("h2").text(generateQuote()).css(style);
});
You want the index var to be recalculated each time you call the function otherwise it will never change
Marius Brad
@mbrad26
Feb 11 2016 13:27
@Motass it...worked. Thanks
CamperBot
@camperbot
Feb 11 2016 13:27
mbrad26 sends brownie points to @motass :sparkles: :thumbsup: :sparkles:
:star: 314 | @motass | http://www.freecodecamp.com/motass
Marius Brad
@mbrad26
Feb 11 2016 13:27
Now I just need to figure out why.
Thomas
@Motass
Feb 11 2016 13:28
I meant $(".quote").click(function() {
$("h2").text(generateQuote()).css(style);
});
Just once, I made a small mistake in my first one. I see that you've put it twice in your code
Marius Brad
@mbrad26
Feb 11 2016 13:30
I .ve took it down ..don't worry
So var index needs to be defined inside the function
Thomas
@Motass
Feb 11 2016 13:32
Yes, everytime you call the function it is redefined with a new value
Marius Brad
@mbrad26
Feb 11 2016 13:33
but it was defined outside...
Thomas
@Motass
Feb 11 2016 13:33
If you put it at the same level as the var "style", it is defined only once and then never change
Marius Brad
@mbrad26
Feb 11 2016 13:33
the function
If it wasn't for the var style it would have worked...or not
Thomas
@Motass
Feb 11 2016 13:36
It's not related to the var style
It won't work if it's not redefined each time you click the button
I'm not sure to be clear :/
Marius Brad
@mbrad26
Feb 11 2016 13:38
OK...I feel like I'm not making any progress:(. So much to know and such a small brain..
Thomas
@Motass
Feb 11 2016 13:40
Maybe you mix up the declaration and the definition of the variable
var style = {"font-weight": "bold", "font-size": "1.5em"}
var index;
var generateQuote = function() {
index = Math.floor(Math.random() * quoteArr.length);
return quoteArr[index]["quote"];
};
That would still be okay
Marius Brad
@mbrad26
Feb 11 2016 13:41
.var index; is a declaration
var index = "something" is a definition
I get that
Ignore the dot.
Thomas
@Motass
Feb 11 2016 13:44
Ok
Dylan
@dhcodes
Feb 11 2016 14:01
I have an issue with my code for the Stylize Camper News Zipline.
If you see the result here: http://codepen.io/dhcodes/pen/VeEpOQ
I want to link the article title to the article, but it only works for some of the articles. For the others, it puts an empty <a></a> tag after the headline instead of turning the headline into the link
any idea why? I think the JSON is the same for all the article links
@Code21k Your height is the same for all divs. You need to make separate divs with varying heights, otherwise they just cover each other. Also, it would help you to visualize it if you change each background to something different so you can see how they are being applied to the page.
Dylan
@dhcodes
Feb 11 2016 14:07
nvm on my question, I think I fixed it.
alex chirila
@al3xoi
Feb 11 2016 14:08
I need a little help with the Simon Zipline
I cant seem to figure out why the game wont work properly after using the on/off switch
Can anyone take a look please?
kirbyedy
@kirbyedy
Feb 11 2016 14:18
@dhcodes did you fixed it ?
Marius Garbea
@MariusGarbea
Feb 11 2016 14:18
hi guys!
i need some help with my twitch app
if i try to add a new streamer it doesn't work
the array is updated but i don't know what should i do next
Dylan
@dhcodes
Feb 11 2016 14:20
@kirbyedy well, I added the link via a wrap command and it works for the headlines, but now I'm working on adding the description back without it being linked too. I might need to add a span or something
@al3xoi I took a look but I'm too newb to help. Sorry
kirbyedy
@kirbyedy
Feb 11 2016 14:20
'<a href='+ item.link +'/a>'
Dylan
@dhcodes
Feb 11 2016 14:21
@kirbyedy okay, I'll try that first
@al3xoi I did end up playing simon for awhile though so that's pretty cool
@kirbyedy that worked, but I don't really know why. Could you explain why you would /a> the end of an href?
I was trying to do it like I would see in html... <a href="#"> Headline </a>
so to me your markup would equate to <a href="#" /a>
which seems weird
alex chirila
@al3xoi
Feb 11 2016 14:25
@dhcodes no problem, yeah it almost works, I mean it works well until you turn the game off and back on
kirbyedy
@kirbyedy
Feb 11 2016 14:25
no idea :D
Dylan
@dhcodes
Feb 11 2016 14:25
lol I'll search around
kirbyedy
@kirbyedy
Feb 11 2016 14:26
but its working
Dylan
@dhcodes
Feb 11 2016 14:26
that it is
@kirbyedy nope, found a bug. It adds /a to the end of each link. I'll play around with it some more. Thanks for the help though
CamperBot
@camperbot
Feb 11 2016 14:28
dhcodes sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 451 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
kirbyedy
@kirbyedy
Feb 11 2016 14:28
:thumbsup:
Christian Kumala
@Code21k
Feb 11 2016 14:29
@dhcodes so should i set fix height to div? like height xxpx;
@dhcodes but will it responsive/full screen as width and height screen
Dylan
@dhcodes
Feb 11 2016 14:33
@Code21k the way I did it was to make a div for each section and then apply a different background for each div
@Code21k but you at least need to give each div a min-height so that it shows regardless of how much content is in it. Otherwise the size would depend on what you put in the div
so make 4 divs
with 4 diff ids
and then apply a diff. background to each id
and a min-height of 100vh or w/e you want
@Code21k each bg also needs a background-attachment: fixed attribute in the CSS for the scroll through to work
Sidharth Kriplani
@sidkrip
Feb 11 2016 14:36
how do I get the quotes?
for the quote machine?
Dylan
@dhcodes
Feb 11 2016 14:36
gotta go figure mine out, good luck
@sidkrip just google for some and put them in an array or object
i just looked for some about coding but they can be w/e you want
Sidharth Kriplani
@sidkrip
Feb 11 2016 14:37
Like just take some quotes like 9-10 and put all of them in an array ?
Christian Kumala
@Code21k
Feb 11 2016 14:38
i tried like this
but the image is being cut
Dylan
@dhcodes
Feb 11 2016 14:39
@sidkrip yeah, and then you set the button up to get a random quote from the array each click
@sidkrip so you can use Math.floor and Math.random
for a rounded random number
and then use that to go to an index point in your array
Michael Clautice
@MichaelClautice
Feb 11 2016 14:39
hello - I’m having trouble understanding “Everything Be True” in the “Intermediate Algorithm Scripting” section. (this is the first time i've been in this chat room, by the way)
Thomas
@Motass
Feb 11 2016 14:40
@dhcodes you forgot the quotes for the href attributes and you don't close the td tags
Dylan
@dhcodes
Feb 11 2016 14:41
@Motass okay, i'll check that out before I submit it . Thanks
CamperBot
@camperbot
Feb 11 2016 14:41
dhcodes sends brownie points to @motass :sparkles: :thumbsup: :sparkles:
:star: 315 | @motass | http://www.freecodecamp.com/motass
Dylan
@dhcodes
Feb 11 2016 14:41
@Code21k what do you mean the image is being cut?
@Code21k it's working like the example
if you want it to have the full image in each section, you'd need to add attributes for the height and width, but that wouldn't really work because it would squeeze your height down so that the picture is skewed
or you can make your min-height larger to accomodate the height and width attributes you add to the images
Sidharth Kriplani
@sidkrip
Feb 11 2016 14:43
thanks @dhcodes
CamperBot
@camperbot
Feb 11 2016 14:43
sidkrip sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star: 329 | @dhcodes | http://www.freecodecamp.com/dhcodes
Thomas
@Motass
Feb 11 2016 14:43
@dhcodes No prob. That should fix your link issue
Dylan
@dhcodes
Feb 11 2016 14:44
@Motass I fixed the link issue by adding a space before the closing '>' tag
@Motass as for not closing the <td> tags, does jquery do that for you because in the output in the Chrome developer tool, they are closed
or is Chrome auto-closing them because it assumes I meant to?
Thomas
@Motass
Feb 11 2016 14:49
The browser always tries to "fix" the errors to render something correct, that's why you see the td tags closed and some links worked while others didn't
If you could see the raw html from the page source you would see a difference with what the Chrome developer tool actually displays
Dylan
@dhcodes
Feb 11 2016 14:51
@Motass Okay, I closed them now. Good catch. I'm going to submit it to code review once I make sure the user stories are all fulfilled.\
Christian Kumala
@Code21k
Feb 11 2016 14:53
yeah @dhcodes , i mean i want full imange in each section
but thanks for ur answer
CamperBot
@camperbot
Feb 11 2016 14:53
code21k sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star: 331 | @dhcodes | http://www.freecodecamp.com/dhcodes
Christian Kumala
@Code21k
Feb 11 2016 14:54
and btw, what the difference between <div> and <section>?
Dylan
@dhcodes
Feb 11 2016 14:55
well section is an HTML5 reference for the different blocks of a site so you'd have to read up about it
I just meant section as the different parts of your page (about, portfolio, etc.)
Christian Kumala
@Code21k
Feb 11 2016 14:56
owh like other page in one page?
but what is the different with div?
@Code21k section came along after div because people were using divs to separate the parts of their page
alex chirila
@al3xoi
Feb 11 2016 15:00
I fixed the issue with my Simon zipline
Dylan
@dhcodes
Feb 11 2016 15:00
so HTML5 was like "hey, let's just make a thing that does that called section"
alex chirila
@al3xoi
Feb 11 2016 15:01
I had to remove the event handler attacked to the button clicks
Dylan
@dhcodes
Feb 11 2016 15:01
at least, that's my armchair view of it
@al3xoi cool, good work
alex chirila
@al3xoi
Feb 11 2016 15:02
@dhcodes ty man, you too
Christian Kumala
@Code21k
Feb 11 2016 15:03
hmm ok thanks bro,
sleep now, see you next time hahaha
Kevin Han
@kevhan94
Feb 11 2016 15:18
Hey guys, I'm working on the random quote machine, and I've finished the displaying quote part with the press of a button, but my problem is that I can only press the button once, when the form loads, then it becomes unfunctional
is there a workaround to this?
Dylan
@dhcodes
Feb 11 2016 15:27
@kevhan94 can you post your code?
the quote button posts a quote and the author
but i think its an onclick event error
i need to reset the form somehow without the quote disappearing
Dylan
@dhcodes
Feb 11 2016 15:29
@kevhan94 you need to move your function todo inside of your getQuote and then call get quote on the click
so that it reruns the random number, the action to get the quote/author, and the changing of the HTML on each click
gotta go now, but good luck!
Kevin Han
@kevhan94
Feb 11 2016 15:30
oh thanks alot that makes sense since my quote is a global variable so it doesnt change unless i do getquote again
Dylan
@dhcodes
Feb 11 2016 15:31
yeah, or you might be able to get away with adding the onclick to be multiple functions
just put a comma between them
Marius Brad
@mbrad26
Feb 11 2016 15:52
Could someone have a look at my CSS and tell me why the Generate button acts so weird - after you press it it doesn't return to the original state/look. Thanks. http://s.codepen.io/mbrad26/debug/XXxBKB
Y4T9Code
@Y4T9Code
Feb 11 2016 15:58
@mbrad26 add a mousout function in your js, with css which makes the buttons text colour white
Marius Brad
@mbrad26
Feb 11 2016 16:02
Ok I'll give it a try. Thanks
Y4T9Code
@Y4T9Code
Feb 11 2016 16:05
np
Jack
@FooIsFood
Feb 11 2016 16:07
how do I add my own images in CodePen?
I know how to add it to the HTML, just don't know where/how to put it up for use with the CodePen activity
Y4T9Code
@Y4T9Code
Feb 11 2016 16:08
upload them onto a image sharing website
and then use the url thingy
Jack
@FooIsFood
Feb 11 2016 16:08
thanks
batman137
@batman137
Feb 11 2016 16:11
what do you use as image hosting
?
Marius Brad
@mbrad26
Feb 11 2016 16:14
@Dukbcaaj ..it worked..kind of, but now I've lost the hover effect...
Its weird.
Y4T9Code
@Y4T9Code
Feb 11 2016 16:18
hold on a sec
Marius Brad
@mbrad26
Feb 11 2016 16:19
:)
Y4T9Code
@Y4T9Code
Feb 11 2016 16:24
@mbrad26
.quote:hover {
  background: #996633;
  border: 2px solid #996633;
  color: black;
}
Marius Brad
@mbrad26
Feb 11 2016 16:28
Ok..thanks..but my problem is that the button after is pressed once it doesn't return to the original look which is : .quote { background: rgba(0, 0, 0, 0.3); border: 2px solid #996633; color: #fff; float: left; font-weight: bold; }
Y4T9Code
@Y4T9Code
Feb 11 2016 16:32
use .hover()
instead of :hover
like the js thingy
then you can add how its going to be after mouseout as well
but i dunno if itll work for sure
Marius Brad
@mbrad26
Feb 11 2016 16:35
@Dukbcaaj Thanks anyway:0
CamperBot
@camperbot
Feb 11 2016 16:35
mbrad26 sends brownie points to @dukbcaaj :sparkles: :thumbsup: :sparkles:
Salman Shahid
@salman-shahid
Feb 11 2016 16:36
Any ideas on why my js doesn't execute?
CamperBot
@camperbot
Feb 11 2016 16:36
:star: 390 | @dukbcaaj | http://www.freecodecamp.com/dukbcaaj
Jonathan Coleman
@jondcoleman
Feb 11 2016 16:39
@mynameissal it is executing but I don't think you can pass an object into .css()
value should either be a string or an array
oh just kidding I see it at the bottom ther
there
Salman Shahid
@salman-shahid
Feb 11 2016 16:44
Yeah..
I think it has to be something to do with my CSS
Salman Shahid
@salman-shahid
Feb 11 2016 16:49
Yep, it had to do with my variables. Thanks for looking at i t.
Manish Giri
@Manish-Giri
Feb 11 2016 16:53
anyone here wanna lend a hand with the weather zipline
stacyHere
@stacyHere
Feb 11 2016 16:59
Hi, can anyone help me figure out why this javascript isn't counting down for the pomodoro clock?
function countDown(sec, e){        
        e.innerHTML = sec;    
        if(sec < 1){        
            clearTimeout(timerS);    
            e.innerHTML="DONE!";    
        }        
        sec--;
        var timerS = setTimeout('countDown('+sec+',"'+e+'")',1000);
}
Joseph Morse
@jnmorse
Feb 11 2016 17:05
@stacyHere what is e? more descriptive variable names are kinda helpful, but could you just copy and paste your pen url so can see the complete script?
Jonathan Coleman
@jondcoleman
Feb 11 2016 17:07
@stacyHere I don't think you should be including your callback function as a string in your setTimeout method
stacyHere
@stacyHere
Feb 11 2016 17:07
I'm only focusing on the break time for seconds at the moment. I've been working on this for quite awhile
I'm not sure how else to do it
Jonathan Coleman
@jondcoleman
Feb 11 2016 17:08
is this meant to be a recursive function?
stacyHere
@stacyHere
Feb 11 2016 17:08
yea, because I want it to kep going until the time is 0
Michael Holst
@MHolst1
Feb 11 2016 17:10
~~~
function getQuote() {    
  $.get("http://www.stands4.com/services/v2/quotes.php?uid=4835&tokenid=removeme&searchtype=RANDOM", function(data) {
    theQuote = data.getElementsByTagName("quote")[0].innerHTML; // .innerHTML fixes some odd bug where theQuote can only be used once
    theAuthor = data.getElementsByTagName("author")[0].innerHTML  ;   
    $('#quote').html('"' + theQuote + '"');
    $('#quoteBy').html("-" + theAuthor);
    $('#twtBtn').attr("data-text", "hello"); //insert text into tweet - NOT WORKING
  });  
}
I can't seem to get .attr() to add to my #twtBtn HTML, at least within .get()'s callback. It works fine outside of the callback, but I need it within the callback to access my 'theQuote' variable later (which I can't use outside of .get()). Can anyone shed some light?
Jonathan Coleman
@jondcoleman
Feb 11 2016 17:12
@stacyHere I think it should be more like this:
  function countDown(sec, e){        
        e.innerHTML = sec;    
        if(sec < 1){        
            clearTimeout(timerS);    
            e.innerHTML="DONE!";    
        }        
        sec--;
        var timerS = setTimeout(countDown(sec,e),1000);
}
how do I trigger the function on your pen?
Joseph Morse
@jnmorse
Feb 11 2016 17:13
@stacyHere well looks like your script is trying to find a element with an id of time, but there isn't one, but I think its preferable to set you initial values in the JavaScript then render those values to your document. Also I'm not sure what your trying to do with your onChange events.
stacyHere
@stacyHere
Feb 11 2016 17:13
lol at the moment after you enter min and sec in the break time it'll populate the main countdown
onChange calls findme() so that counDown() can use those id's to get the time and element to put that time into
Aengus
@ShinyGreenCode
Feb 11 2016 17:18
Does anyone have any hints on getting started with the Camper News challenge? I have get JSON > data vomit on page... not sure what to do next?
stacyHere
@stacyHere
Feb 11 2016 17:18
thanks @jnmorse I'm going to work on this some more, when I replaced with your suggested code it displays DONE! instead of the number
CamperBot
@camperbot
Feb 11 2016 17:18
stacyhere sends brownie points to @jnmorse :sparkles: :thumbsup: :sparkles:
:star: 383 | @jnmorse | http://www.freecodecamp.com/jnmorse
Joseph Morse
@jnmorse
Feb 11 2016 17:19
@stacyHere that was @jondcoleman
stacyHere
@stacyHere
Feb 11 2016 17:20
@jondcoleman thanks, I'm sorry, I clicked wrong name
CamperBot
@camperbot
Feb 11 2016 17:20
stacyhere sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
Jonathan Coleman
@jondcoleman
Feb 11 2016 17:20
gitter autocomplete is the worst ;p
CamperBot
@camperbot
Feb 11 2016 17:20
:star: 528 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Matthew Boland
@mattboland
Feb 11 2016 17:21
I'm working on the calculator project. can someone help me understand why in my javascript once i empty my display the next step of appending the ans variable will not happenhttp://codepen.io/MattBoland/pen/qbQKVV?editors=1010
Jonathan Coleman
@jondcoleman
Feb 11 2016 17:22
@stacyHere also recommend adding your event handlers in javascript rather than in your html. e.g.:
document.getElementById("start").addEventListener('click', function(e){
  console.log(e.target)
})
Kevin Han
@kevhan94
Feb 11 2016 17:22
Hey guys, I'm finishing up the Random Quote Project and I'm having trouble with the tweet button. Is there a way I can dynamically retrieve the quote from the HTML field and then feed it into the twitter web intent?
stacyHere
@stacyHere
Feb 11 2016 17:23
thanks, I'll try that
Kevin Han
@kevhan94
Feb 11 2016 17:24
Maybe i should use jquery to create the link?
but how do i add it to the twitter web intent format?
Jonathan Coleman
@jondcoleman
Feb 11 2016 17:34
@kevhan94 yeah you can use javascript to set the link value
so update that element's attribute on each new quote
Joseph Morse
@jnmorse
Feb 11 2016 17:35
@kevhan94 http://codepen.io/jnmorse/pen/eJjYrO is an example using web intent, wherever your generate the quote you would replace 'Hello World' with your message
Michael Holst
@MHolst1
Feb 11 2016 17:50

Does anyone know why this .attr doesn't work, when .html does?

function getQuote() {    
  $.get("http://www.stands4.com/services/v2/quotes.php?uid=4835&tokenid=removeme&searchtype=RANDOM", function(data) {
    theQuote = data.getElementsByTagName("quote")[0].innerHTML; // .innerHTML fixes some odd bug where theQuote can only be used once
    theAuthor = data.getElementsByTagName("author")[0].innerHTML  ;   
    $('#quote').html('"' + theQuote + '"');
    $('#quoteBy').html("-" + theAuthor);
    $('#twtBtn').attr("data-text", "hello"); //insert text into tweet - NOT WORKING
  });  
}

Here's my codepen: http://codepen.io/mholst1/pen/zrymgw?editors=1111

Rex Schrader
@SaintPeter
Feb 11 2016 17:51

Impending Migration May Result in Initial Slowdowns

We're going to be rolling out a fix shortly that should improve server performance longer term, but the initial result will be more server load. Expect to see some slowdowns until users have migrated.
Sam Reeves
@smreeves
Feb 11 2016 17:58
Hey guys! Working on the Pomodoro clock and was curious if anyone had a good resource to select a sound from so I can use it when the timer changes?
Michael Holst
@MHolst1
Feb 11 2016 18:00
Or maybe alternatively find a way to use my 'theQuote' and 'theAuthor' variables outside of the callback?
Jonathan Coleman
@jondcoleman
Feb 11 2016 18:01
@sreeves89 got mine from http://soundbible.com/
Joseph Morse
@jnmorse
Feb 11 2016 18:05
@MHolst1 to be honest I'm not sure, I think its easier to just use the web intent option
Sam Reeves
@smreeves
Feb 11 2016 18:07
Perfect, thanks @jondcoleman!
CamperBot
@camperbot
Feb 11 2016 18:07
sreeves89 sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
:star: 530 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Rex Schrader
@SaintPeter
Feb 11 2016 18:08

If you are unable to submit a challenge, refresh your browser! New code in place!

Jonathan Coleman
@jondcoleman
Feb 11 2016 18:08
@MHolst1 if you are using the twitter widget that won't work unless you trigger the widget javascript again for it to pick up the changees
look at the twitter javascript widget docs for how to do that @MHolst1. Or just use web intents which is definitely easier for this use case
Michael Holst
@MHolst1
Feb 11 2016 18:11
@jondcoleman Don't you still have to use .attr to inject the quote into the href for the web intent?
@jondcoleman I suppose .html could be used to fill the whole <a></a>
I was just hoping to avoid the re-loading of the tweet button every time I generate a new quote
by that I mean it disappearing off the page and then re-appearing
Jonathan Coleman
@jondcoleman
Feb 11 2016 18:13
@MHolst1 yeah just change the href attribute or replace the whole link with each new quote
Manoj Singh
@manojansh
Feb 11 2016 18:46
I need help please!

$(document).ready(function(){

var session=25;
var breakLength=0;
$('.adjust').click(function(){

    var id = $(this).attr('id');

    console.log("ID: "+id);

});

});

my code is not printing the id

Michael Holst
@MHolst1
Feb 11 2016 18:48
@jondcoleman Thanks for the advice, much appreciated!
CamperBot
@camperbot
Feb 11 2016 18:48
mholst1 sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
:star: 532 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Jonathan Coleman
@jondcoleman
Feb 11 2016 18:48
:thumbsup:
LennixM
@LennixM
Feb 11 2016 19:08
Hey guys, i really need help with the calculator challenge. I'm stuck and it's so frustrating.
var count = "";
var calc= [];
var operation = "";
var number = "";
var math = {
  "+": function (x,y) {x+y},
  "-": function (x,y) {x-y},
  "/": function (x,y) {x/y},
  "*": function (x,y) {x*y},
  "%": function (x,y) {x%y}
}
var answer = 0;


$("button").click(function() {
  var text = $(this).attr("value");
  if (text !== "AC" && text !== "=" && text !== "CE" && text !== "ANS") {
    if (text === "+" || text === "-" || text === "*" || text === "/" || text === "%" ) {
      number = parseInt(count);
      calc.push(number);
      operation = text;
      count = count + text;
      $(".textbox").val(count);
    }
    else {
      number = number + text;
      count = count + text;
      $(".textbox").val(count);
    }

  }
  else if(text === "AC") {
    count = "";
    calc = "";
    $(".textbox").val(count);
  }

  else if(text === "=") {
    calc = "";
    answer = math[operation](calc[0], calc[1]);
    $("textbox").val(math[operation](calc[0], calc[1]));
  }

});
this is my code so far. The problem that i have is that whenever i press AC the operator buttons don't work anymore, i can click them but the value is not shown in the display
ahmed ibrahim
@ahmo10
Feb 11 2016 19:09
hello everyone
anyone who has completed the RandomMachineQuotes how can incorporate the tweet the random QUote
LennixM
@LennixM
Feb 11 2016 19:13
Can you rephrase you question? I don't understand it
ahmed ibrahim
@ahmo10
Feb 11 2016 19:15
on the Random Quote Machine project you are suppose to tweet the quote after it has been generated
how can i do that?
LennixM
@LennixM
Feb 11 2016 19:16
Yeah, you need to implement a button that has the twitter share link as href
I used an array that had every word as an element and added the array element and %20 to the link. I used a for loop to do that
but there are certainly other ways
ahmed ibrahim
@ahmo10
Feb 11 2016 19:18
so you need a js function
LennixM
@LennixM
Feb 11 2016 19:21
well you don't need it to put a share button on the page. But if you want the pop-up window to have the quote as a prewritten quote you'd need a js function
ahmed ibrahim
@ahmo10
Feb 11 2016 19:25
@LennixM Thank you
CamperBot
@camperbot
Feb 11 2016 19:25
ahmo10 sends brownie points to @lennixm :sparkles: :thumbsup: :sparkles:
:star: 267 | @lennixm | http://www.freecodecamp.com/lennixm
LennixM
@LennixM
Feb 11 2016 19:32
Can nobody help me?:(
KacperPorembski
@KacperPorembski
Feb 11 2016 19:42
hi guys! I've spent whole day looking for some mistake in my navigation but i see nothing. It looks good but when i click the button to unfold a menu nothing happens. Please have a look
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Kacper Porembski</a>
      </div>
      <div class="collapse navbar-collapse" id="myNavbar">
        <ul class="nav navbar-nav navbar-right">
          <li><a href="#Home">Home</a></li>
          <li><a href="#About">About</a></li>
          <li><a href="#Portfolio">Portfolio</a></li>
          <li><a href="#Contact">Contact</a></li>
        </ul>
      </div>
    </div>
  </nav>
Evan
@emillion90
Feb 11 2016 19:47
I'm just getting started on the JS Calculator. Can someone help me get going. I'm trying to figure out how I would get the value from the button clicked and append that to the input box.
Here's what I have, I know it's not right at all.
'''
$('button').click(function() {
$('#input').append(this)
});
'''
CamperBot
@camperbot
Feb 11 2016 19:48
:bulb: to format code use backticks! ``` more info
Jonathan Coleman
@jondcoleman
Feb 11 2016 19:48
@emillion90 you probably want this.text() or something like that
try console.log(this) and see what you get
one of the properties in that object should contain the number you want
Evan
@emillion90
Feb 11 2016 19:54
console.log(this) prints out this:
"<button class='button' value='3'>
          3
        </button>"
Jonathan Coleman
@jondcoleman
Feb 11 2016 19:58
ok yeah so you should be able to use either this.text() or this.value maybe?
try console logging those and see what you get @emillion90
@emillion90 and you probably want the .val() function for setting your input value rather than append()
Evan
@emillion90
Feb 11 2016 20:02
Ah ok. Your suggestion worked, thanks @jondcoleman.
CamperBot
@camperbot
Feb 11 2016 20:02
emillion90 sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
:star: 534 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Jonathan Coleman
@jondcoleman
Feb 11 2016 20:02
:clap:
Alique Williams
@AliqueWilliams
Feb 11 2016 20:22
Is anyone here good with materialized css?
Brett
@BLayman
Feb 11 2016 21:03
I'm trying to make a simple jQuery function where I click a button, and it adds 5 to the html of one of my elements. I can't seem to make it work. I'm guessing there is an easy way to do this, but I can't seem to find it. Here's what I have:
$(".incwrk").click(function(){
    $("#min").html(function(){
     var added = ("#min").html() + 10
     return added;
    });
  });
Keari Eggers
@kme211
Feb 11 2016 21:05
@BLayman Which element do you want to add 5 to?
Brett
@BLayman
Feb 11 2016 21:05

min

Manish Giri
@Manish-Giri
Feb 11 2016 21:05
@BLayman you're forgetting to select ("#min"), need the $ infront
var added = ("#min").html() + 10
Keari Eggers
@kme211
Feb 11 2016 21:05
$("#min").append("5");
Unless you're trying to do math. The code I gave will just literally append 5 to the end of the HTML of min.
Brett
@BLayman
Feb 11 2016 21:07
Yeah I'm trying to mathematically add 5
Keari Eggers
@kme211
Feb 11 2016 21:11
@BLayman Anything returned from .html() will be a string so you're going to have to convert it to a number before adding 5 to it.
Joey Melnick
@joeymelnick
Feb 11 2016 21:11
this might be easy but... i'm trying to build a navbar w/dropdown menu and it won't dropdown in codepen. I even copied an example from bootstraps website just to see if it would work and it didnt
Brett
@BLayman
Feb 11 2016 21:12
@kme211 I see, is there a method I can use to do that?
Joey Melnick
@joeymelnick
Feb 11 2016 21:12
bootstrap is loaded through codepen as well
Keari Eggers
@kme211
Feb 11 2016 21:18
@BLayman There's more than one method to convert a string to a number. Udemy has a blog post you might find helpful.
Brett
@BLayman
Feb 11 2016 21:21
@kme211 Got it to work using parseInt(), thanks!
CamperBot
@camperbot
Feb 11 2016 21:21
blayman sends brownie points to @kme211 :sparkles: :thumbsup: :sparkles:
:star: 323 | @kme211 | http://www.freecodecamp.com/kme211
Brett
@BLayman
Feb 11 2016 21:21
@Manish-Giri Good catch, thanks.
CamperBot
@camperbot
Feb 11 2016 21:21
blayman sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 632 | @manish-giri | http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Feb 11 2016 21:25
@joeymelnick put your pen here, so we can look!
buttons only visible on xs
Manish Giri
@Manish-Giri
Feb 11 2016 21:27
@joeymelnick what's supposed to dropdown?
ah the xs button, never mind
@joeymelnick solved, you need to add the JS components of BS as well. go to settings > javascript > quickadd > bootstrap. Then run.
Joey Melnick
@joeymelnick
Feb 11 2016 21:34
ohhh
duh duh
@Manish-Giri thanks!
CamperBot
@camperbot
Feb 11 2016 21:34
joeymelnick sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 633 | @manish-giri | http://www.freecodecamp.com/manish-giri
Jonathan
@jxvo92
Feb 11 2016 21:43
hey there. is there a way to implement a like counter for the random quote machine on codepen?
i've checked online and it seems that most involve some sort of server-side code
Manish Giri
@Manish-Giri
Feb 11 2016 21:44
@jxvo92 it's quite easy with Angular
Jonathan Coleman
@jondcoleman
Feb 11 2016 21:44
@jxvo92 what do you mean by a counter?
Vincent Lingle-Munos
@valmunos
Feb 11 2016 21:52
Working on the portfolio page and having some trouble with imgaes
images, sorry
Keari Eggers
@kme211
Feb 11 2016 21:54
@jxvo92 If you fake the data, you won't need any server-side code.
@valmunos What kind of trouble?
Vincent Lingle-Munos
@valmunos
Feb 11 2016 21:56

I am creating separate classes for each section of my webpage, using a different background image in each one. My CSS is of the format:

.intro-section {
background: url("url text here") no-repeat center center fixed;
}

for whatever reason, it is having trouble finding the url I have given. What's interesting is if I use the same exact url in an <img> element in my HTML box, it has no trouble finding the image. Can somebody please explain what the issue might be?

Jonathan
@jxvo92
Feb 11 2016 21:56
all my quotes are in an array. i am trying to create a separate likes array with the same amount of indexes based on quotes.length, each starting at 0 likes. when the user clicks the like button, the likes counter for that particular quote increases by 1 (something likes[n] += 1, where n matches the random quote quotes[n]). clicking the button again counts as an unlike (likes[n] -=1 ).
Vincent Lingle-Munos
@valmunos
Feb 11 2016 22:00
@kme211 I can send you the url if you'd like
Keari Eggers
@kme211
Feb 11 2016 22:00
@valmunos Sure, I'll take a look
Adam Yuhasz
@jayuhasz
Feb 11 2016 22:00
seems like you pretty much need to learn angular, any recommendations for places to look at?
Jonathan
@jxvo92
Feb 11 2016 22:04
i guess i will have to continue learning and cry to implement the counter later. here's my code so far so you can get a feel of what i was trying to accomplish: http://codepen.io/jxvo/pen/OMwXxQ
Keari Eggers
@kme211
Feb 11 2016 22:06
@valmunos There's probably a CSS rule that is overriding your background image. Do you have a link to your codepen?
Maddah Anass
@unlimiworks
Feb 11 2016 22:09
Hello guys. Is anyone proficient in flex display ?
Keari Eggers
@kme211
Feb 11 2016 22:10
@jxvo92 I feel like it might be easier to keep your data together. [{quote: "A quote", likes: 0}, {quote: "Another quote", likes: 0}]
Vincent Lingle-Munos
@valmunos
Feb 11 2016 22:13
So, I played around with some stuff, got the first image up but none of my other div's can get their background images oup
also, I need to go to class here in like 5 minutes
Keari Eggers
@kme211
Feb 11 2016 22:17
@jxvo92 You don't have to edit all those quotes to accomplish that though. Use map to iterate over all those quotes and set their likes to 0.
// after quotes have been defined
quotes = quotes.map(function(quote) {
        // return an object for each quote in the array
        // with the quote being the value of "text"
        // and likes being 0 being the default value of "likes"
    return {
        text: quote,
        likes: 0
    };
})
Jonathan
@jxvo92
Feb 11 2016 22:17
@kme211 If there's a way to automate that it would be better. I plan on adding more quotes once I come back to this project
Keari Eggers
@kme211
Feb 11 2016 22:17
@valmunos I'll check it out.
Maddah Anass
@unlimiworks
Feb 11 2016 22:20
@jxvo92 The only way to automate quotes is to use an external API. But for now, manual input is enough, even recommended if you're new. You'll have many opportunities to learn about APIs integration in later projects
Bruce Young
@mutantspore
Feb 11 2016 22:21
@valmunos no dot in front of two of the section classes in your css
Maddah Anass
@unlimiworks
Feb 11 2016 22:21
Can anyone help me with a flex problem i'm having ?
Bruce Young
@mutantspore
Feb 11 2016 22:22
@valmunos and unnecessary brackets around teh background stuff in teh portfolio section in the css
Jonathan
@jxvo92
Feb 11 2016 22:23
@kme211 thanks for reminding me about .map! i knew there was an easier way to organize things
CamperBot
@camperbot
Feb 11 2016 22:23
jxvo92 sends brownie points to @kme211 :sparkles: :thumbsup: :sparkles:
:star: 324 | @kme211 | http://www.freecodecamp.com/kme211
Vincent Lingle-Munos
@valmunos
Feb 11 2016 22:23
@mutantspore thanks! figured it was something like that
CamperBot
@camperbot
Feb 11 2016 22:23
valmunos sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1116 | @mutantspore | http://www.freecodecamp.com/mutantspore
Maddah Anass
@unlimiworks
Feb 11 2016 22:24
http://codepen.io/UnlimiWorks/pen/vLvjEO This is the current project i'm working on. I'm trying to mimic the style of the example project. I have a problem with aligning items using flex to my #display button
Jonathan
@jxvo92
Feb 11 2016 22:24
i still have to get the like button functionality down but i'll come back to it as i've successfully integrated what's required of the zipline
Maddah Anass
@unlimiworks
Feb 11 2016 22:25
The items stay in their respective position no matter what I try
@jxvo92 Good luck with that :) The like, tweet, share etc... work just as normal links, you just need to append infos relative to your quote with the initial links
Keari Eggers
@kme211
Feb 11 2016 22:27
@UnlimiWorks Are you wanting "Test" and "25:00" to be centered within the display button?
Maddah Anass
@unlimiworks
Feb 11 2016 22:28

I want to apply something like :

#display {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

But it doesn't seem to work

In short, yes. Centered with equal space between them vertically
@kme211 Forgot to mention you :)
Keari Eggers
@kme211
Feb 11 2016 22:34
@UnlimiWorks Seems to work when I add your above code. Are you maybe missing a semicolon somewhere?
Maddah Anass
@unlimiworks
Feb 11 2016 22:35
@kme211 Let me check
Nope... It seems it's something related to codepen ? When I run my code from gitter preview (my link above) it's working perfectly
Keari Eggers
@kme211
Feb 11 2016 22:38
@UnlimiWorks Try setting the vendor prefixing to "autoprefixer" in the CSS settings.
Maddah Anass
@unlimiworks
Feb 11 2016 22:39
@kme211 Did that and refreshed, but no changes sadly :worried:
Keari Eggers
@kme211
Feb 11 2016 22:41
@UnlimiWorks What browser are you using?
Maddah Anass
@unlimiworks
Feb 11 2016 22:41
I'm using the latest firefox version
Flex is supported though, if i trust caniuse.com. I also used flex in my precedent projects without any problem
Keari Eggers
@kme211
Feb 11 2016 22:45
@UnlimiWorks Yeah, there's definitely a difference in Firefox
Maddah Anass
@unlimiworks
Feb 11 2016 22:46
I'll try in another browser
Oh. I found the problem
Keari Eggers
@kme211
Feb 11 2016 22:47
@UnlimiWorks What was it?
Maddah Anass
@unlimiworks
Feb 11 2016 22:47
'Firefox does not support Flexbox in button elements' - Known issues, caniuse.com
So basically, it's a firefox problem as you predicted
Keari Eggers
@kme211
Feb 11 2016 22:47
@UnlimiWorks Ah... Good to know!
Maddah Anass
@unlimiworks
Feb 11 2016 22:48
It happens that my specific use case is the one that doesn't work. Unlucky :)
This message was deleted
@kme211 Thanks for your help ! I'll try to find a clean solution to that
CamperBot
@camperbot
Feb 11 2016 22:49
unlimiworks sends brownie points to @kme211 :sparkles: :thumbsup: :sparkles:
:star: 325 | @kme211 | http://www.freecodecamp.com/kme211
Keari Eggers
@kme211
Feb 11 2016 22:49
@UnlimiWorks At least it's an easy fix! Just change the button to a div.
Maddah Anass
@unlimiworks
Feb 11 2016 22:50
@kme211 I'll try to use a div inside the button, i'm using that one for all my JS events :worried:
I hate useless divs though :)
Keari Eggers
@kme211
Feb 11 2016 22:54
@UnlimiWorks Yeah, I would just replace the button with a div and add cursor: pointer; to the CSS for it.
Axhon
@axhon
Feb 11 2016 23:50

hi guys, i don't really have a specific question i guess. I'm working on the local weather project and it's my first time working with api calls so i've been doing research. i have been actively trying to keep my project code for the work so far as pure javascript, so that i can understand the language underlying language before using libraries or frameworks.

anyways, i guess my question is are there any examples of i guess 'pretty' js implementations of api calls. i'm using the api @ openweathermap if curious