These are chat archives for FreeCodeCamp/HelpFrontEnd

13th
Feb 2016
wyattelliott
@wyattwade
Feb 13 2016 00:02
@jharrowmortelliti
delete lines 42 and 43 in your html
these ones <div class="bg-overlay2"> <div class="container-fluid">
they conflict with your css
fixed the problem for me
often times bootstrap and css combined creates problems.
jakehm
@jakehm
Feb 13 2016 00:04
i thought bootstrap was a set of css styles
wyattelliott
@wyattwade
Feb 13 2016 00:07
right
that's why there can be conflicts when you're using both of them
@jharrowmortelliti did it work for you?
jakehm
@jakehm
Feb 13 2016 00:24
@wyattwade yeah thanks!
CamperBot
@camperbot
Feb 13 2016 00:24
jharrowmortelliti sends brownie points to @wyattwade :sparkles: :thumbsup: :sparkles:
:star: 253 | @wyattwade | http://www.freecodecamp.com/wyattwade
Lewis
@Lewis65
Feb 13 2016 00:58
Hey everyone! Happy Friday :P
I am a bit confused about $.getJSON - why does it return some things encoded? (i.e. a comma sent in the query is returned as though I had encoded it as %2C) Is there a way to stop this?
Tim Bell
@MindfulBell
Feb 13 2016 01:29
@Lewis65 my understanding of getJSON is that it simply returns an object in JSON format. Why are you getting your query back?
Adam Camacho
@Adancode
Feb 13 2016 01:35
Guy, any tips on what to read to be able to complete the Wikipedia Viewer? I've been stuck on it for like a week or two, and I can't seem to make any progress.
Alexander Køpke
@alexanderkopke
Feb 13 2016 01:38
@Adancode what are you having trouble with?
Adam Camacho
@Adancode
Feb 13 2016 01:40
I just would like to know what sources I can read to understand how to solve it. The API documentation is not doing it for me. If that's all there is, then I guess I can keep hacking futilely at it, lol.
Alexander Køpke
@alexanderkopke
Feb 13 2016 01:41
I understand. The API didn't do it for me either at first.
@Adancode are you using getJSON to make GET requests?
Adam Camacho
@Adancode
Feb 13 2016 01:44
Yeah, I can't get it to work with pure javascript, here's the code I have so far, I got the JSON code from some Bauer site

$(document).ready(function() {

$("#searchMe").click(function() {
searchTerm = $('#typeMe').val();
});

$.getJSON('http://en.wikipedia.org/w/api.php?action=parse&page='+ searchTerm + '&prop=text&format=json&callback=?', function(json) {
console.log(searchTerm);
$('#wikiInfo').html(json.parse.text['*']);
$("#wikiInfo").find("a:not(.references a)").attr("href", function(){ return "http://www.wikipedia.org" + $(this).attr("href");});
$("#wikiInfo").find("a").attr("target", "_blank");

   });

});

var searchTerm;

And that makes a wikipedia page for "undefined" appear (because searchTerm is set to undefined on page load).
But I want to be able to put the value from the .click into the getJSON
And no matter how I place it, inside the .click function, outside, I can't get the variable to transfer from the click to the get JSON. It does capture it on the click, so searchTerm does hold the text entered into the search box.
Alexander Køpke
@alexanderkopke
Feb 13 2016 01:48
ok you can make a function with getJSON inside that takes a search parameter
Evan
@emillion90
Feb 13 2016 01:49
Can someone help me understand why when I click on my button in the calculator the value appears in the input area and disappears immediately?
http://codepen.io/emillion/pen/mVaGQm?editors=0010
Alexander Køpke
@alexanderkopke
Feb 13 2016 01:49
this function you can call within your .click function with searchTerm as the argument
Adam Camacho
@Adancode
Feb 13 2016 01:49
Hmmmm...all right, I'll try that, thanks @alexanderkopke !
CamperBot
@camperbot
Feb 13 2016 01:49
adancode sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 473 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Adam Camacho
@Adancode
Feb 13 2016 01:50
Working on it...I'll check back if I can't get the variable to flow through!
Dan Stockham
@DanStockham
Feb 13 2016 01:51
This doesn't make any sense http://jsfiddle.net/rtoal/ThPEH/ If you are using a score based system, wouldn't the taken spots that don't relate to the "3-in-a-row" just skrew the score?
Alexander Køpke
@alexanderkopke
Feb 13 2016 02:00
@Adancode heading to bed but basically keep the code you have but 'wrap' a function around the getJSON code you have: function searcher(srch){$.getJSON etc} and in your click you add: searcher(searchTerm); at the buttom. I tried the action=parse method too but the info it returned wasn't usable to me. action=query was the way I went.. $.getJSON('https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch='+ item+'&format=json&callback=?', function(json) {etc
Adam Camacho
@Adancode
Feb 13 2016 02:23
Thanks @alexanderkopke! I was aways from the screen, but just saw this, it's a HUGE help!
CamperBot
@camperbot
Feb 13 2016 02:23
adancode sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:warning: adancode already gave alexanderkopke points
Casey Heath
@ExhibitArts
Feb 13 2016 02:38
I'm trying to create a smooth scroll for my anchor link. I can't get my js code to work and it says "Unexpected token <". I don't see any typos. Anyone know what it could be? - https://gist.github.com/anonymous/7fa4ec423416281b67cb
kaizen711
@kaizen711
Feb 13 2016 02:47
Anyone know why my image isn't centering within a column in bootstrap?
it's the image with the chinese characters
http://codepen.io/kaizen7/pen/BjOQoB
you can see what I mean when you resize the window small
its the image of the chinese characters in the navbar
Lewis
@Lewis65
Feb 13 2016 02:56
@MindfulBell sorry, I should clarify that where the JSON object returns the url for something, it returns the url as if it had been encoded.
So the actual context is using the twitch api, when I send a multiple-channel query e.g. /streams?channel=test_channel,test_channel2,storbeck&callback=? - the link that is returned in the JSON object is /streams?channel=test_channel%2Ctest_channel2%2Cstorbeck&callback=?
And no streams are returned in my JSON object, which makes me think that something about my code is being encoded before it hits the twitch API, and I think that this thing could be the $.getJSON method... any thoughts? (Anyone?)
Casey Heath
@ExhibitArts
Feb 13 2016 03:00

FeelTheBern

Andrew Charlebois
@andrewchar
Feb 13 2016 03:29
whoa they added and changed a bunch of stuff in the curriculum
hmm they took the calculator and put it into advanced project
ive been studying jQuery to do it for the past day and a half lol
idietmoran
@idietmoran
Feb 13 2016 03:53
@andrewchar it's better that way, i think the calc, simon, and tictactoe were a bit advanced for where they were
Casey Heath
@ExhibitArts
Feb 13 2016 03:54
This message was deleted
Andrew Charlebois
@andrewchar
Feb 13 2016 03:54
i think it's good. i didnt feel that i had the skills to code a calculator. @idietmoran
which is why i decided to learn more jQuery and build it with jquery
Brett Guillory
@kurzninja
Feb 13 2016 03:54
working on the calculator now :)
Andrew Charlebois
@andrewchar
Feb 13 2016 03:55
i just came back to start making it and now i see its all changed lol
Brett Guillory
@kurzninja
Feb 13 2016 03:55
dammit, they moved calculator again?
Andrew Charlebois
@andrewchar
Feb 13 2016 03:55
i think i will finish the project thou. its already started anyway
Casey Heath
@ExhibitArts
Feb 13 2016 03:58
I have a problem with my anchor link. I want make an anchor point to smooth scroll to a certain div on my page. I can't seem to get my js code to work with my anchor point. Please help? I have a problem with my anchor link. I want make an anchor point to smooth scroll to a certain div on my page. I can't seem to get my js code to work with my anchor point. Please help? http://www.codepen.com/ExhibitArts/pen/jWdPPQ
Brett Guillory
@kurzninja
Feb 13 2016 03:58
I like that @QuincyLarson did the tribute page to Norman Borlaug, great choice :)
Andrew Charlebois
@andrewchar
Feb 13 2016 03:58
im thinking about what to do for the tribute
dont think it will take me more then 2 hours to do it.
bitgrower
@bitgrower
Feb 13 2016 04:00
Calculator is still a valid FrontEnd ... they only removed one project, about stylizing Camper News -- News is being retired in favor of having a subreddit
Andrew Charlebois
@andrewchar
Feb 13 2016 04:00
i kinda liked that they had us make a portfolio first. im happy i did that first now i can put all my stuff in it. and i have my portfolio linked to my social media to show it off
William Bowen
@WilliamBowen
Feb 13 2016 04:00
@ExhibitArts I don't think you need the script tags when using codepen
Andrew Charlebois
@andrewchar
Feb 13 2016 04:02

@ExhibitArts i cant even look at it. im getting this message This web page is not available

DNS_PROBE_FINISHED_NXDOMAIN

no idea what that means, i dont have a firewall or anything.
William Bowen
@WilliamBowen
Feb 13 2016 04:02
link should be .io, not .com
Andrew Charlebois
@andrewchar
Feb 13 2016 04:02
oh
William Bowen
@WilliamBowen
Feb 13 2016 04:03
@ExhibitArts Yeah, once you remove the script tags and fix some of the whitespace, it looks like it's working
Casey Heath
@ExhibitArts
Feb 13 2016 04:05
@WilliamBowen Okay, but when I run it in Chrome or any browser for that matter it doesn't give me an error but for some reason it still doesn't work.
@WilliamBowen Could you send me the code you edited?
William Bowen
@WilliamBowen
Feb 13 2016 04:11
just a second
 $(function() { // This will select everything with the class smoothScroll // This should prevent problems with carousel, scrollspy, etc...
   $.smoothScroll('.smoothScroll').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
 var target = $(this.hash);
 target = target.length ? target : $.smoothScroll('[name=' + this.hash.slice(1) + ']');
 if (target.length) {
 $('html,body').animate({
   scrollTop: target.offset().top
 }, 100); // The number here represents the speed of the scroll in milliseconds
 return false;
 }
 }
 });
 });
Casey Heath
@ExhibitArts
Feb 13 2016 04:11
@WilliamBowen Thanks!
CamperBot
@camperbot
Feb 13 2016 04:11
exhibitarts sends brownie points to @williambowen :sparkles: :thumbsup: :sparkles:
:star: 271 | @williambowen | http://www.freecodecamp.com/williambowen
William Bowen
@WilliamBowen
Feb 13 2016 04:12
your welcom
welcome
@ExhibitArts did that fix your issue?
Casey Heath
@ExhibitArts
Feb 13 2016 04:16
On my end it doesn't seem to be working. I need the licence link at the top right to scroll to the bottom. I can get it to do that but it needs some smooth scroll to make it look better.
William Bowen
@WilliamBowen
Feb 13 2016 04:18
That I don't know, but nitpicking should that be "license"?
Ok, breaktime over. I have to go back to work now. :sad:
Casey Heath
@ExhibitArts
Feb 13 2016 04:28
That script was written by someone else. I just searched for smooth scroll scripts and found it. You said it works on your end but other people who have also tried to use it have said that they had the same problem I'm having now. I'm wandering if it has to do with my HTML?
This message was deleted
This message was deleted
Zachary Hyder
@zacharyhyder
Feb 13 2016 05:32
I am not sure why my carousel isn't working. I know this is a long bit. But anything would be appreciated. It will not change items. It is stuck on the first slide.
           <div id="myCarousel" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
    <li data-target="#myCarousel" data-slide-to="3"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://guardianlv.com/wp-content/uploads/2013/10/steve-jobs-650x365.png" alt="Steve Jobs">
    </div>

    <div class="item">
      <img src="http://www.wired.com/images_blogs/gadgetlab/2011/10/apple_II_01.jpg" alt="Apple II">
    </div>

    <div class="item">
      <img src="http://fm.cnbc.com/applications/cnbc.com/resources/img/editorial/2015/05/01/102641316-steve-jobs.1910x1000.jpg" alt="Iphone">
    </div>

    <div class="item">
      <img src="http://www.centerforworklife.com/cfwl-content/uploads/2013/10/30953-Steve-jobs-change-quote-HVwq.jpeg" alt="Focus">
    </div>
  </div>

  <!-- Left and right controls -->
  <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
idietmoran
@idietmoran
Feb 13 2016 05:48
@zacharyhyder did you load the bootstrap.js into the file?
akashratiwal
@akashratiwal
Feb 13 2016 06:05
Can anyone help me with AI design for tic tac toe ?
three images in the thumbnail dont apear what could be the reason
please help
h4r1m4u
@h4r1m4u
Feb 13 2016 08:07
@RakshithNM remove the '~original' bit at the end of the img URLs:
// nay
<img id="work-image" src="http://i1077.photobucket.com/albums/w466/bellare545/quora-icon_zpsg9r04m01.png~original" alt="quora">

// yay
<img id="work-image" src="http://i1077.photobucket.com/albums/w466/bellare545/quora-icon_zpsg9r04m01.png" alt="quora">
wyattelliott
@wyattwade
Feb 13 2016 08:27
Hey! @h4r1m4u
h4r1m4u
@h4r1m4u
Feb 13 2016 08:27
@wyattwade hey dude, how's it hanging?
wyattelliott
@wyattwade
Feb 13 2016 08:28
Good man
h4r1m4u
@h4r1m4u
Feb 13 2016 08:28
glad to hear that
wyattelliott
@wyattwade
Feb 13 2016 08:28
Been working on this tic tac toe ai all week -_-
Finally done, it was 450 lines of code at first
Got it down to 280.... There are some giant lines still tho
Anyway... Can't wait to get on to another project
How's it going with you man ? @h4r1m4u
h4r1m4u
@h4r1m4u
Feb 13 2016 08:30
nice! my entire JS for the tic-tac-toe is around 300 lines. the AI was quite challenging
i'm good. kinda busy with work and actual projects at the moment, so not much time to pursue FCC
wyattelliott
@wyattwade
Feb 13 2016 08:31
Game design right?
h4r1m4u
@h4r1m4u
Feb 13 2016 08:31
not at the moment. all web stuff
wyattelliott
@wyattwade
Feb 13 2016 08:32
Good man
Using node?
h4r1m4u
@h4r1m4u
Feb 13 2016 08:33
was thinking about it for one of the new projects i have on the table, but i probably won't in the end. i need more time to experiment with it. i'll probably use django instead
wyattelliott
@wyattwade
Feb 13 2016 08:33
Python is really cool
I used Ruby on Rails for about half a year or so
Noticed I was using a ton of 'magic' tho
h4r1m4u
@h4r1m4u
Feb 13 2016 08:34
yeah, i like python. it's been a while since i wrote something in it, so i'll need a refresh on the syntax, but it'll probably still be faster than trying to do it in node
wyattelliott
@wyattwade
Feb 13 2016 08:35
thats how I feel too. It can be a pain when you're already familiar with one framework
h4r1m4u
@h4r1m4u
Feb 13 2016 08:36
from what i read, node also doesn't seem to be particularly amazing for traditional CRUD websites which is what this project is, so django seems to make more sense overall
wyattelliott
@wyattwade
Feb 13 2016 08:36
Is node better for single page applications?
Yeah rails is rly good for crud as well
Rails scaffold - half of its done for you
h4r1m4u
@h4r1m4u
Feb 13 2016 08:38
yeah, rails and django is basically the same thing, just different languages (and i prefer python to ruby). yeah, node seems to be more suited for real-time concurrent operations apps (like chat)
this is a pretty good summary on the topic: http://blog.apcelent.com/why-use-nodejs-tutorial.html
wyattelliott
@wyattwade
Feb 13 2016 08:40
I wonder if a js framework that's more suited for crud will be built
I'll check that out, thanks
h4r1m4u
@h4r1m4u
Feb 13 2016 08:41
yeah, that's what i looked at as well. there are some good efforts in the area being made and i'm particularly excited by http://www.keystonejs.com which is what i strongly considered initially, but it's nowhere as proven and stable as django
wyattelliott
@wyattwade
Feb 13 2016 08:41
Are you working on any fix projects right now?
h4r1m4u
@h4r1m4u
Feb 13 2016 08:41
fix?
wyattelliott
@wyattwade
Feb 13 2016 08:42
Fcc**
iPhone autocorrect --

h4r1m4u
@h4r1m4u
Feb 13 2016 08:42
oh. no, not at the moment. work got in the way. i finished the entire front-end section and did a couple of the challenges from the backend section. then they restructured that and i haven't had time to go back to it yet
wyattelliott
@wyattwade
Feb 13 2016 08:43
I wonder why they took angular out
And yeah they keep doing that
A blessing and a curse
h4r1m4u
@h4r1m4u
Feb 13 2016 08:44
because angular 1 is slowly being phased out and angular 2, which is going to be quite different from what i hear, is not out yet
i'm kinda glad. i used angular for one of my projects and didn't like it one bit
wyattelliott
@wyattwade
Feb 13 2016 08:45
I've heard such mixed things about it
More than about just any other js framework
And yeah to make things works they did that to angular 2
h4r1m4u
@h4r1m4u
Feb 13 2016 08:47
yeah. i think people got really excited about it and started using it and now they're heavily invested in it and it'd be difficult to swap to something else.
react.js has me more excited, but i haven't actually tried it out. just read a bunch of stuff about it.
wyattelliott
@wyattwade
Feb 13 2016 08:48
Exited for fcc's tutorials on it
Kinda waiting for that
h4r1m4u
@h4r1m4u
Feb 13 2016 08:49
yeah. that's one thing that keeps me from progressing on FCC. everything after the frontend is basically just different projects to work on without any tutorials/guidance. i might as well work on actual projects/things i'll use and learn/figure out stuff that way
kinda no point to do the ziplines just for the sake of the ziplines, if you know what i mean
wyattelliott
@wyattwade
Feb 13 2016 08:50
Yeah like client projects or your own ideas
h4r1m4u
@h4r1m4u
Feb 13 2016 08:50
exactly
wyattelliott
@wyattwade
Feb 13 2016 08:50
I'd love to start making mobile dating apps
Lol
h4r1m4u
@h4r1m4u
Feb 13 2016 08:50
:)
wyattelliott
@wyattwade
Feb 13 2016 08:50
Or games or some shit
h4r1m4u
@h4r1m4u
Feb 13 2016 08:50
that market's pretty saturated
wyattelliott
@wyattwade
Feb 13 2016 08:50
Game dating
h4r1m4u
@h4r1m4u
Feb 13 2016 08:50
hard to come up with something new
wyattelliott
@wyattwade
Feb 13 2016 08:50
Rly saturated
Yeah, there's still stuff out there tjo
Tho
Hey man I kind of have a question out of left field
I'm starting to apply for jobs and try tailoring code for other ppl to read
What's a pet peeve of yours when reading other people's code
h4r1m4u
@h4r1m4u
Feb 13 2016 08:54
the biggest one - not enough comments
comment your code heavily, it makes understanding it so much easier
number 2) - name your variables and functions, so that i can understand what they're for just from the name.
wyattelliott
@wyattwade
Feb 13 2016 08:56
Screenshotted that
h4r1m4u
@h4r1m4u
Feb 13 2016 08:56
var a = []; doesn't tell me anything. var userMoves = []; makes me immediately grasp what it's about
wyattelliott
@wyattwade
Feb 13 2016 08:56
Thanks man @h4r1m4u
CamperBot
@camperbot
Feb 13 2016 08:56
wyattwade sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1390 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
wyattelliott
@wyattwade
Feb 13 2016 08:56
Even when looping?
h4r1m4u
@h4r1m4u
Feb 13 2016 08:56
yeah, no worries
wyattelliott
@wyattwade
Feb 13 2016 08:56
For example - for (var i = 1
h4r1m4u
@h4r1m4u
Feb 13 2016 08:57
no, that's pretty standard. changing it would actually make it more difficult to understand :)
wyattelliott
@wyattwade
Feb 13 2016 08:57
got it
William Bowen
@WilliamBowen
Feb 13 2016 08:57
i = iterator
Wrote that jumblefuck of code
Excuse my French
I'm applying for an apprenticeship and they want to see it
I'll take your recommendations into consideration when fixing it up tomorrow @h4r1m4u
William Bowen
@WilliamBowen
Feb 13 2016 08:59
personal preference, I like to see function explanations just above the function, rather than inside them.
wyattelliott
@wyattwade
Feb 13 2016 08:59
If anyone in this channel wants to give the harshest criticism possible be my guest. It needs to be fixed.... It works but I need to improve it
h4r1m4u
@h4r1m4u
Feb 13 2016 08:59

@wyattwade yeah, add more comments. comment each of the function and explain what it does. another problem that i see with that particular code is that you repeat yourself a lot. for example:

  $('#container-1').click(function () {
       clickFunction(1)
    });
    $('#container-2').click(function () {
       clickFunction(2)
    });
    $('#container-3').click(function () {
       clickFunction(3)
    });
    $('#container-4').click(function () {
       clickFunction(4)
    });
    $('#container-5').click(function () {
       clickFunction(5)
    });
    $('#container-6').click(function () {
       clickFunction(6)
    });
    $('#container-7').click(function () {
       clickFunction(7)
    });
    $('#container-8').click(function () {
       clickFunction(8)
    });
    $('#container-9').click(function () {
       clickFunction(9)
    });

this could be quite easily optimized into 3 or 4 lines of code

lpix
@lpix
Feb 13 2016 09:00
@wyattwade ha! you knew I was playing!
don't like the colors...that's all, let me keep playing
wyattelliott
@wyattwade
Feb 13 2016 09:00
I was trying to find away around that with a for loop today
@lpix yeah gonna change the colors first thing tomorrow
@h4r1m4u I was trying to find a way around that today. The repetition of the click functions
h4r1m4u
@h4r1m4u
Feb 13 2016 09:02
@wyattwade you could change the ids to a class and then write only one click handler for the class. then inside the click handler you could get the value of the id or some data field and send that to the clickFunction instead
does that make sense?
wyattelliott
@wyattwade
Feb 13 2016 09:03
it almost does
I've tried something similar
I have a container class
And each container Id (1 -9) is part of that class
But when I direct the click handler to the class, each of the nine containers fire
Rather than 'this' .container
h4r1m4u
@h4r1m4u
Feb 13 2016 09:06
something like this should work:
    $('.field').click(function () {
       var fieldId;
       fieldId = this.attr('id');
       clickFunction(fieldId.substr(fieldId.length - 1));
    });
whereby field is the class on each of your board squares

on that note, these code blocks are also very repetitive and difficult to understand:

            if (move == 0 &&((pattern.indexOf(1) !== -1 && pattern.indexOf(7) !== -1) || (pattern.indexOf(5) !== -1 && pattern.indexOf(6) !== -1 ) || (pattern.indexOf(2) !== -1 && pattern.indexOf(8) !== -1) || (pattern.indexOf(4) !== -1 && pattern.indexOf(6) !== -1)) && $('#container-4').html() == "") {
                compArray.push(4);
                $('#container-4').html(compSymbol).css({'background-color': compColor});
                move = 1;
            }

there should be a way to optimize that somehow

wyattelliott
@wyattwade
Feb 13 2016 09:08
@h4r1m4u Thank you!!!!
CamperBot
@camperbot
Feb 13 2016 09:08
wyattwade sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: wyattwade already gave h4r1m4u points
wyattelliott
@wyattwade
Feb 13 2016 09:08
just logged on to my comp
right @h4r1m4u those code blocks are the biggest challenge I face
@h4r1m4u I can condense the code by at least 50% by creating nested for loops
and it's easier to understand
h4r1m4u
@h4r1m4u
Feb 13 2016 09:09
yeah. or some sort of a function
wyattelliott
@wyattwade
Feb 13 2016 09:10
the only problem is that I get bucks
right
*bugs
h4r1m4u
@h4r1m4u
Feb 13 2016 09:10
i don't have a quick fix for these, i'd need to spend more time on understanding what's going on there, but do try to refactor that code before you send it over to the potential employer
wyattelliott
@wyattwade
Feb 13 2016 09:11
that was definitely my biggest concern
those blocks
h4r1m4u
@h4r1m4u
Feb 13 2016 09:11
yeah, right on
wyattelliott
@wyattwade
Feb 13 2016 09:12
was on the fence about fixing it but now i'll fix it for sure
thanks man
don't worry about looking too far into it. I'll do a complete refactor
h4r1m4u
@h4r1m4u
Feb 13 2016 09:12
you're most welcome
keep me posted how it goes in terms of your internship/employment. i want to know when you land something!
wyattelliott
@wyattwade
Feb 13 2016 09:14
thank you man!
I'm stoked on you making games
h4r1m4u
@h4r1m4u
Feb 13 2016 09:14
that was a while ago. still hoping to get into it, but right now it's all web stuff
wyattelliott
@wyattwade
Feb 13 2016 09:14
if you're still thinking about it that is
h4r1m4u
@h4r1m4u
Feb 13 2016 09:14
(which i enjoy too)
wyattelliott
@wyattwade
Feb 13 2016 09:15
gotta do what you've gotta do
same here
h4r1m4u
@h4r1m4u
Feb 13 2016 09:15
yeah
wyattelliott
@wyattwade
Feb 13 2016 09:15
is there any type of app that you're interested in
for your own purposes?
*interested in building
h4r1m4u
@h4r1m4u
Feb 13 2016 09:17
i've got a few ideas for web apps. i'd love to build some data analytics / stats app for dota, but the dota api is real shit. and there's an app that i want to build for a newsletter service that i use which allows you to manage their webhooks.
the project that i'm working on now is a donation tracker for charities which is pretty interesting as well
wyattelliott
@wyattwade
Feb 13 2016 09:20
I have a buddy that works for blizzard
in cali
h4r1m4u
@h4r1m4u
Feb 13 2016 09:21
nice! what does he do?
wyattelliott
@wyattwade
Feb 13 2016 09:21
i should tell him their apis are shit
lol
he's an business analyst
entry level
h4r1m4u
@h4r1m4u
Feb 13 2016 09:21
dota is valve's baby now :)
that's cool
wyattelliott
@wyattwade
Feb 13 2016 09:21
ahhhh didn't realize that
well I don't see why they would have trouble fixing that
considering the intricacy of some of their other dev
h4r1m4u
@h4r1m4u
Feb 13 2016 09:23
well, valve is infamous for keeping the dev teams really small and they've got other stuff to work on. i don't think the api is a priority for them. it works, but it's just really complicated and poorly documented
wyattelliott
@wyattwade
Feb 13 2016 09:23
makes sense
well it's good to hear they're upkeeping the game to an extent
miss that sh*t
got such terrible grades when I played it. But man, nothing teaches you strategy and teamwork like dota / TFT
h4r1m4u
@h4r1m4u
Feb 13 2016 09:25
yeah. they do constantly keep pushing it forward, the game's changing a lot. i'm stoked by the entire e-sports industry development, it's really exciting for me to see
hahaha, easy to sink a lot of time into it
wyattelliott
@wyattwade
Feb 13 2016 09:26
do you have a personal twitch account?
h4r1m4u
@h4r1m4u
Feb 13 2016 09:26
did you know that ESPN launched a dedicated e-sports channel couple of weeks ago?
i do, but i don't stream. only watch other streams
wyattelliott
@wyattwade
Feb 13 2016 09:26
I hear you
i'd love to get in on a game. I'd just have to install it
probably suck now....
h4r1m4u
@h4r1m4u
Feb 13 2016 09:28
it'd take you some time getting back into it, but if you played it before, i'm sure it'd be quick
wyattelliott
@wyattwade
Feb 13 2016 09:28
yeah, I'd need to relearn hotkeys etc
This message was deleted
This message was deleted

 $('.field').click(function () {
       var fieldId;
       fieldId = this.attr('id');
       clickFunction(fieldId.substr(fieldId.length - 1));
    });
almost have this thing working
h4r1m4u
@h4r1m4u
Feb 13 2016 09:30
what's the issue that makes it not work?
wyattelliott
@wyattwade
Feb 13 2016 09:30
so rather than ('.field') I think I need ('.container')
tried that
Richard Andrews
@Whiplash5057
Feb 13 2016 09:31
hey guys .... why can I not add any links to my project <a href > tag isn't working
PLS PLS PLS PLS help!!
wyattelliott
@wyattwade
Feb 13 2016 09:32
each container id ( #container-1 , #container-2....) also falls under .container
h4r1m4u
@h4r1m4u
Feb 13 2016 09:32
@Whiplash5057 which links are not working?
Y4T9Code
@Y4T9Code
Feb 13 2016 09:32
@Whiplash5057 they seem to be fine
Richard Andrews
@Whiplash5057
Feb 13 2016 09:32
facebook twitter instagram etc
Y4T9Code
@Y4T9Code
Feb 13 2016 09:33
you haven't put an a tag
Richard Andrews
@Whiplash5057
Feb 13 2016 09:33
I put them in the button ...wait ... I just removed it
i'll Put them back
h4r1m4u
@h4r1m4u
Feb 13 2016 09:35

@Whiplash5057 don't nest the <a>s inside <button>s. change the <button>s to <a>s with the .btn class applied :

<button class="btn col-md-2" style="background-color : #21759b">Codecademy</button>

to

<a class="btn col-md-2" style="background-color : #21759b" href="http://codecademy.com" target="_blank">Codecademy</a>
don't forget the target="_blank" attribute, otherwise the links won't open properly (it's a codepen thing)
Y4T9Code
@Y4T9Code
Feb 13 2016 09:36
open it in a new tab thingy
with _blank
h4r1m4u
@h4r1m4u
Feb 13 2016 09:37
@wyattwade yeah, you'd have to use .container instead of .field. i didn't check your HTML before when i gave you that example
wyattelliott
@wyattwade
Feb 13 2016 09:37
yeah got container in there
it's late here, probably missing something small
Richard Andrews
@Whiplash5057
Feb 13 2016 09:37
@h4r1m4u isn't there a closing tab for <a> ??
wyattelliott
@wyattwade
Feb 13 2016 09:37
i've got it on line 30
h4r1m4u
@h4r1m4u
Feb 13 2016 09:38
@Whiplash5057 oops, yeah. oversight on my part. fixed above
wyattelliott
@wyattwade
Feb 13 2016 09:38
never used .substr so it's a little new to me
looking it up now
h4r1m4u
@h4r1m4u
Feb 13 2016 09:39
@wyattwade ah, i'm a retard. change fieldId = this.attr('id'); to fieldId = $(this).attr('id');
Richard Andrews
@Whiplash5057
Feb 13 2016 09:39
@h4r1m4u And in the change to ..part of your code don't i need to use the button tag ??
wyattelliott
@wyattwade
Feb 13 2016 09:40
YES!!!!!!
that's fking awesome!!
h4r1m4u
@h4r1m4u
Feb 13 2016 09:40
@Whiplash5057 no, you don't need to use <button>. we're using <a> instead (which is what should be used for links) and styling the <a>s to make them look like buttons with the .btn class
wyattelliott
@wyattwade
Feb 13 2016 09:40
earlier in the day I was trying to implement that
h4r1m4u
@h4r1m4u
Feb 13 2016 09:41
@wyattwade :D
Richard Andrews
@Whiplash5057
Feb 13 2016 09:41
@h4r1m4u OK let me try that !!
wyattelliott
@wyattwade
Feb 13 2016 09:41
wasn't sure it was possible to use .this in a jquery class to refer to a specific id
awesome
you are very intelligent thank you again man
wow.........
h4r1m4u
@h4r1m4u
Feb 13 2016 09:41
@wyattwade just to explain, the this in $(this).attr('id') refers to the element that you clicked on (because it's inside the click handler)
that's why we can then call the attr() method on it and get the id
wyattelliott
@wyattwade
Feb 13 2016 09:42
got it
so if you stated $(this).attr('class') it would refer to each button in the class?
woops
* $(this).attr('class')
h4r1m4u
@h4r1m4u
Feb 13 2016 09:43
that would get you the value of the class attribute, yeah. in your case 'container'
which is the same for each of the squares
Richard Andrews
@Whiplash5057
Feb 13 2016 09:44
@h4r1m4u It still isn't working
wyattelliott
@wyattwade
Feb 13 2016 09:44
can't thank you enough man @h4r1m4u
CamperBot
@camperbot
Feb 13 2016 09:44
wyattwade sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: wyattwade already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Feb 13 2016 09:44
@wyattwade no worries, man
wyattelliott
@wyattwade
Feb 13 2016 09:44
ok i'll be back in 10
h4r1m4u
@h4r1m4u
Feb 13 2016 09:45
@Whiplash5057 you forgot to add the target attribute as i mentioned above
that's why codepen prevents the links from opening
// nay
<a class = "btn col-md-2" style = "background-color : #00aced" href = "https://mobile.twitter.com/account">Twitter</a
// yay
<a class = "btn col-md-2" style = "background-color : #00aced" href = "https://mobile.twitter.com/account" target="_blank">Twitter</a
Richard Andrews
@Whiplash5057
Feb 13 2016 09:46
AAAAWWWWWWWWWWEEEEEEEEEESSSSSSSSSSOOOOOOOOOMMMMMEEEEEEE!!!!! @h4r1m4u
thanks @h4r1m4u IT bloody worked !!!
CamperBot
@camperbot
Feb 13 2016 09:46
whiplash5057 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1391 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 13 2016 09:46
:D you're welcome
wyattelliott
@wyattwade
Feb 13 2016 09:47
you should be famous mate @h4r1m4u
got a youtube or a twitter that you post on?
h4r1m4u
@h4r1m4u
Feb 13 2016 09:48
lol. i'm not that good :)
i'll PM you
wyattelliott
@wyattwade
Feb 13 2016 09:48
thanks man
you're a good teacher tho
not many are knowledgeable and good teachers
i feel like... you know how wealthy old business men play golf together
wouldn't mind getting a round of dota lol
h4r1m4u
@h4r1m4u
Feb 13 2016 09:50
hahaha. if you get back into dota, let me know. i'd be happy to play together, though my ping on the US servers is not amazing
wyattelliott
@wyattwade
Feb 13 2016 09:56
i'll do an chinese server
Pradeep CE
@cepradeep
Feb 13 2016 09:56
Dota seems to be everywhere :P
wyattelliott
@wyattwade
Feb 13 2016 09:57
i may not be carrying much weight anyway. How much worse could a little lag make it
h4r1m4u
@h4r1m4u
Feb 13 2016 09:57
hahaha
@pradeepce no escaping from it!
wyattelliott
@wyattwade
Feb 13 2016 09:57
if you ahve any install recommendations let me know
i'll do a search now
h4r1m4u
@h4r1m4u
Feb 13 2016 09:58
@wyattwade you just need steam (from valve), then install it from it. it's completely free
Pradeep CE
@cepradeep
Feb 13 2016 09:58
@h4r1m4u Play on! :)
wyattelliott
@wyattwade
Feb 13 2016 10:00
on it @h4r1m4u
h4r1m4u
@h4r1m4u
Feb 13 2016 10:01
:thumbsup:
wyattelliott
@wyattwade
Feb 13 2016 10:05
stoked on your site
build this thing from scratch>???
dotas almost running
shit it's late here.....
h4r1m4u
@h4r1m4u
Feb 13 2016 10:06
it runs on wordpress. i used an off-the-shelf theme but heavily modified it
what's your bandwidth?!? it's like a 6GB install
wyattelliott
@wyattwade
Feb 13 2016 10:07
right. it still has a ways to go actually
gonna be afk 10 mins and mb when i get back
h4r1m4u
@h4r1m4u
Feb 13 2016 10:08
haha ok :)
wyattelliott
@wyattwade
Feb 13 2016 10:08
brb
wyattelliott
@wyattwade
Feb 13 2016 10:28
k it installed
i'll get demolished in a few rounds tomorrow
in the meantime I better catch some zzzz's
have a good day man @h4r1m4u
h4r1m4u
@h4r1m4u
Feb 13 2016 10:28
@wyattwade you too bud!
wyattelliott
@wyattwade
Feb 13 2016 10:29
peace!!!!
Jan Pribošek
@GreatDanton
Feb 13 2016 10:31
ah I still can't get new game button to work correctly. If anyone has an idea how to escape from a game() function [line 202] when I click on new game button [line 273], let me know: http://codepen.io/GreatDanton/pen/VeVBPN?editors=0010
h4r1m4u
@h4r1m4u
Feb 13 2016 14:37

@GreatDanton don't put the square handler inside the game() function. as a matter of fact, you don't need the game() function at all. restructure the code like this:

$('#oImg').click(function() {
  selected = imgO;
  comp = imgX;
  $('.modal').fadeOut(500);
  $('.overlay').fadeOut(350);
  //game();
});

$('#xImg').click(function() {
  selected = imgX;
  comp = imgO;
  $('.modal').fadeOut(500);
  $('.overlay').fadeOut(350);
  //game();
});

 $('.square').click(function() {
  if (selected == imgX) {
// X is first, AI plays when .squared is clicked;
      $(this).append('<img class="no-select" src="'+ selected + '"/>');
      $(this).addClass('disabled');

      // get id of the clicked square and return last number
      var move = $(this).attr('id');
      // get number of
      move = move.substr(move.length - 1);
      userMoves.push(parseInt(move));
      notAllowedMoves.push(parseInt(move));

      if (state(userMoves) == 'won') {
        $('.info').html('You won the game');
        return;
      }

        // AI should wait for your first move
        if (userMoves.length > computerMoves.length){
        // pick random number of the left moves and append picture at that position.
          play();
          if (state(computerMoves) == 'won') {
            $('.info').html('You lost the game');
            return;
          }
        } // end of usermoves if

      // if the game is not over, its a draw!
      if (notAllowedMoves.length >= 9){
        $('.info').html("it's a draw!");
        return;
      }
  }

// #################### PICK O ############################
  else if (selected == imgO) {
    // AI makes first move
    play();
      $(this).append('<img class="no-select" src="'+ selected + '"/>');
      $(this).addClass('disabled');
      // get id of the clicked square and return last number
      var move = $(this).attr('id');
      // get number of
      move = move.substr(move.length - 1);
      userMoves.push(parseInt(move));
      notAllowedMoves.push(parseInt(move));
      if (state(userMoves) == 'won') {
        $('.info').html('You won the game');
        return;
      }
// computer move
      play();
      if (state(computerMoves) == 'won') {
        $('.info').html('You lost the game');
        return;
      }

      if (notAllowedMoves.length >= 9){
        $('.info').html("It's a draw!");
        return;
      }
  }
});

i got rid of the game() function and moved out the click handler outside of it. that way the game is waiting for the user click, until it happens.

this almost fixes it. it works properly if you're playing and starting new games as X. when you play as O, it's a little bit bugged (the computer plays twice in each round), but i'll let you take a stab at figuring out what's causing that
Alique Williams
@AliqueWilliams
Feb 13 2016 15:14
I can't use the HTMLelement.remove() function in a promise. Does anyone know why?
Vince
@Vince33
Feb 13 2016 16:17
Hey Guys, I was planning the contact portion of the portfolio zipline and was wondering if I add a form there is going to be no backend hence it would not be functional was curious to how others approached this
looking for some ideas
Anton Wibowo
@AntonWibowo
Feb 13 2016 16:24
Hi everyone, I was wondering about how we should structure our document. I've looked at a few video tutorials on youtube, and they seem to be structuring the web using CSS only. Features like float left, margin auto, etc etc. While on my first project, I only use Bootstrap's <div class="container"> and it seems to be doing all the work for me.
As a beginner, this confuses me. Am I doing anything wrong ?
Here's the link to my first project : http://codepen.io/AntonWibowo/full/gPqzYb/
Jan Pribošek
@GreatDanton
Feb 13 2016 16:24
@h4r1m4u thanks it's working for x. The reason why it doesnt work for O it's because of the structure of the program. I called play() first and then wait for user input, however if we put everything inside the square click function first play() is only called when the user clicks on the .square and after that another play() is called ( = 2moves for ai). I will try to solve that later ;)
CamperBot
@camperbot
Feb 13 2016 16:24
greatdanton sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1393 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Matthew Boland
@mattboland
Feb 13 2016 16:24
@AntonWibowo that's the beauty of bootstrap!
Jan Pribošek
@GreatDanton
Feb 13 2016 16:24
This message was deleted
CamperBot
@camperbot
Feb 13 2016 16:24
greatdanton sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: greatdanton already gave h4r1m4u points
Andrew Vanboxel
@avanbox
Feb 13 2016 16:28
anyone got a sec to look at my calculator? I cant get my total function working properly and i cant figure out why
Matt Yamamoto
@MattYamamoto
Feb 13 2016 16:28
sure, let's have a look.
Matt Yamamoto
@MattYamamoto
Feb 13 2016 16:33
@avanbox you need to break after each case in your switch statement.
Andrew Vanboxel
@avanbox
Feb 13 2016 16:33
hmmm. thanks @MattYamamoto ill take a look must have missed some.
CamperBot
@camperbot
Feb 13 2016 16:33
avanbox sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 912 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Feb 13 2016 16:33
@avanbox in your getTotal() function
Andrew Vanboxel
@avanbox
Feb 13 2016 16:34
i appreciate your time!
Matt Yamamoto
@MattYamamoto
Feb 13 2016 16:42
@avanbox no problem. And if I might offers some advice, it's better practice keep your HTML and JS as seperate as possible. So do the click bindings in the JS file/section as opposed to the HTML. It makes it easier to maintain, debug, and read. But functionally it obviously still works as you have it.
Andrew Vanboxel
@avanbox
Feb 13 2016 16:45
is they a way to explain what you mean or point me in the right direction of some reading material? So your saying not to use onclick="buttonClicked(1)" for example?
Matt Yamamoto
@MattYamamoto
Feb 13 2016 16:52
@avanbox correct, put that functionality with the rest of your JS. Since you have jQuery loaded you could do
$("#1").on("click", function() {
  buttonClicked(1);
});

// or using vanilla JS
document.getElementById("1").onclick = function() { buttonClicked(1) };
The idea, though, is to keep the structure and functionality speperated.
Andrew Vanboxel
@avanbox
Feb 13 2016 16:57
thank you. Im so far down on the beginner scale. Im just throwing things together at this point. I will take your advice!
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:02

You're welcome. And no worries, we all started where you are. Like I said, what you have is working, so feel free to run with it. But I just want you to be aware that there may be better ways to accomplish things. The more you see the more you learn.
You should also be aware that trickier bindings for multiple elements if you want. For example, instead of using the unique ID for each button and assigning click function for each one, we could use the class that they all share. Then use jQuery's $(this) to reference the element that was clicked.

$(".calc-but").on("click", function() {
  var btnTxt = $(this).text();

// have to do this since your buttonClicked doesn't handle the equals sign
  if(btnTxt != "="){
    buttonClicked($(this).text());
  }

});

that would take care of all the buttons in one fell swoop.

My adivce is to keep doing what you're doing, but at some point experiment with different ways of doing the click bindings.
best of luck!
h4r1m4u
@h4r1m4u
Feb 13 2016 17:03
@GreatDanton cool. yeah, i didn't investigate why it wasn't working for O. left that as a homework for you :)
Andrew Vanboxel
@avanbox
Feb 13 2016 17:04
Thanks again @MattYamamoto
CamperBot
@camperbot
Feb 13 2016 17:04
avanbox sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: avanbox already gave mattyamamoto points
Manoj Singh
@manojansh
Feb 13 2016 17:04
FCC have changed their curriculam???
@MattYamamoto need help sir
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:05
@manojansh sure, what's up?
Manoj Singh
@manojansh
Feb 13 2016 17:05

I want my value of sec to decrease after every 1 second. Heree is my code...

$('.border').click(function(){

    var j=0;
    var sec=[];
    for(var i=59;i>=0;i--)
        sec.push(i);

    console.log(sec);
    setInterval(secondsTimer(sec[j++]),1000);


});

function secondsTimer(sec)
{
    $('#time2').replaceWith('<p id="time2">'+sec+'</p>');
    console.log(sec);

}
what is wrong?
avivlan
@avivlan
Feb 13 2016 17:06
how am I supposed to do the first project? the tribute page one. I can't remember how to do such things with HTML after 50 hours of Javascript bonfires
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:08
@manojansh you need to use an anonymous function to wrap your secondsTimer call. so
setInterval(function() {
  secondsTimer(sec[j++]);
},1000);
also, I don't thinik you need to use the array to store the vlaues. why not just set j = 59; and then in your secondsTimer function decrement j each time.
Manoj Singh
@manojansh
Feb 13 2016 17:10
@MattYamamoto why do i need an anonymous function? I thought window.setInterval is a predefined function.
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:10
@avivlan yes, that's the fun of it isn't it? No time like the present to go back and review!
avivlan
@avivlan
Feb 13 2016 17:11
@MattYamamoto really hard to do without looking at their code
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:15

when you do setInterval(myFunction(), 1000) you are invoking the function myFunction immediately since that's what the () does. So that function runs and then whatever it returns is what setInterval will fire each time. You can do setInterval(myFunction, 1000) (note the lack of () there), but then that doens't work if you need to pass a parameter to myFunction. So you need to use the anonymous wrapping function. which allows you to do whatever you need inside.

setInterval(function() {
  //can call functions and do whatever else you need to in here.
}, 1000);

alternatively you could create another function which takes no parameter and use that

function wrappedSecondsTimer() {
  secondsTimer(sec[j++]);
}

setInterval(wrappedSecondsTimer, 1000);
@avivlan no, I m meant go back through the FCC HTML and CSS stuff
but I suggest you just div in and start playing around... when you get stuck go back through the FCC challenges (or whatever they call them now) and/or ask for help in here.
avivlan
@avivlan
Feb 13 2016 17:19
@MattYamamoto thanks
CamperBot
@camperbot
Feb 13 2016 17:19
avivlan sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 913 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Alicja Raszkowska
@trueskawka
Feb 13 2016 17:24
I can’t get the .mp3 sounds for Simon Game to play on button click
    var one = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound1.mp3");
    var two = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound2.mp3");
    var three = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound3.mp3");
    var four = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound4.mp3");

    $(".sound").on("click", function(){
        switch ($(this).prop('id')){
            case "red":        
                one.play();
                console.log("a");
                break;
            case "green":
                two.play();
                break;
            case "yellow":
                three.play();
                break;
            case "purple":
                four.play();
                break;
            }
    });
do I need a different library for audio? I’m using jQuery
the console.log was just to check the switch implementation
it doesn’t work with any .mp3 files, it does work with .wav, but I just wanted to use the source files from description without having to convert and reupload them somewhere
oh, and the html is:
<button class="btn sound" id="red">red</button>
<button class="btn sound" id="green">green</button>
<button class="btn sound" id="yellow">yellow</button>
<button class="btn sound" id="purple">purple</button>
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:32
@trueskawka that should be correct, in fact I pasted that into jsbin and it works fine.
do you have that in codepen?
can it be a Chromium thing?
I’ve never used it for .mp3 :)
regular Chrome doesn’t play well with my laptop
Manoj Singh
@manojansh
Feb 13 2016 17:35
@MattYamamoto - thanks alot sir, you explained it so beautifully
CamperBot
@camperbot
Feb 13 2016 17:35
manojansh sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 914 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Alicja Raszkowska
@trueskawka
Feb 13 2016 17:37
yeah, just checked on my other computer, it’s Chromium
thanks @MattYamamoto
CamperBot
@camperbot
Feb 13 2016 17:37
trueskawka sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 915 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:38
@trueskawka strange. well, gald you got if figured out.
Alicja Raszkowska
@trueskawka
Feb 13 2016 17:42
apparently “mp3 is not a fully open format” ^^
Matt Yamamoto
@MattYamamoto
Feb 13 2016 17:42
well, that's good to know.
Aengus
@ShinyGreenCode
Feb 13 2016 17:45
@FreeCodeCamp319 Yes I saw that about the Camper News challenge just after I'd got about half way through. Oh well, learned something anyway!
Steven Parker
@Philosophist
Feb 13 2016 18:34
Would anyone be able to help me figure out what happened to fillText() in my code. it stopped working at some point and I can't find out why it's glitching on me. I've followed the operation of the code and tried the same functions in other pens to test each one. The code s running but right at that command, it fails. I'd love to learn about a means of looking even closer at what's happening so that I can figure it out. http://codepen.io/Philosophist/pen/ZQvJym?editors=0010
Jonathan Riley
@rilejon
Feb 13 2016 19:07
Is there a lesson on making certian words in a <li> bold?
h4r1m4u
@h4r1m4u
Feb 13 2016 19:08
@rilejon put them inside a span, make the span bold
(via class)
Matt Yamamoto
@MattYamamoto
Feb 13 2016 19:10
@Philosophist I know very little about the HTML canvas, but it apperas to be a layering issue. You're game board is being drawn over your "O". Move your drawGrid() call to the top of your code (like to line 48), so that the "O" gets drawn on top of the board.
kirbyedy
@kirbyedy
Feb 13 2016 19:11
@rilejon use <strong>
Jonathan Riley
@rilejon
Feb 13 2016 19:12
@kirbyedy I'm a little lost can i see an example
Nairuz.Abulhul
@nairuzabulhul
Feb 13 2016 19:12
Hello everyone I need help with the #Twitchtv zipline
I am able to display online users with their logo pics however I still do not know how to display offline users with their logos
any sugestions ??
h4r1m4u
@h4r1m4u
Feb 13 2016 19:14
@ZeeMax you need to make two different API calls for each streamer - one to the streams API (which is what you already have) and then another to the users API (which is where you can get the logo from, regardless of whether the stream is online or offline)
Jonathan Riley
@rilejon
Feb 13 2016 19:16
@kirbyedy Thanks
CamperBot
@camperbot
Feb 13 2016 19:16
rilejon sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 461 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Nairuz.Abulhul
@nairuzabulhul
Feb 13 2016 19:16
@h4r1m4u is the API for the users https://api.twitch.tv/kraken/streams/
h4r1m4u
@h4r1m4u
Feb 13 2016 19:17
@ZeeMax nope, that's the streams API. the users API is https://api.twitch.tv/kraken/users/
Nairuz.Abulhul
@nairuzabulhul
Feb 13 2016 19:19
@h4r1m4u Thanks I'l l try it
CamperBot
@camperbot
Feb 13 2016 19:19
zeemax sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1394 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Steven Parker
@Philosophist
Feb 13 2016 19:30
@MattYamamoto Thanks! that looks like it's definitely whats happening now that you point it out. Once I operate drawGrid(), it fails to do text after that. Your suggestion of rearranging drawOX didn't fix it, but this does give me a great lead.
CamperBot
@camperbot
Feb 13 2016 19:30
philosophist sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 916 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
mjqblade
@mjqblade
Feb 13 2016 20:10
hey

soo

can anyone help

html```

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>

<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

<p>Top 3 things cats hate:</p>

<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
```

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>

its says your page should have 2 radio button elements

Nisha Shlaymoon
@leaguelism
Feb 13 2016 20:19
Hey guys I finished my tribute page, but I have a problem with my JumboTron
My jumbotrong gets cut out at the very bottom of the page, leaving out a little bit of blue background
I want my jumbo tron to cover the entire vertical screen
I got it
Steven Parker
@Philosophist
Feb 13 2016 21:15
@MattYamamoto jeez. Been working on this problem for days and it turned out the fillStyle() in the drawGrid() function turned the color of my text to the color of the background. It was camouflaged, but there.
tommy
@tommygebru
Feb 13 2016 21:16
hey guys I am using flexbox.... and one of the child elements(flex-item) is an image ..... how do i get the image to stop stretching with the flex-container?
max77p
@max77p
Feb 13 2016 21:33
hey guys looks like the quote web project was moved to intermediate and new project "tribute page" was added
in the user stories it says use whatever api or libraries we need...but this page doesn't require api or anything right?
it seems like a very basic static page
Brett Guillory
@kurzninja
Feb 13 2016 21:53
@max77p all of the projects say that. You might want to use an API for some random image or a color generations library, etc
idietmoran
@idietmoran
Feb 13 2016 22:02

@max77p you dont need an api for that page unless you're trying to do something like import data from wiki or something.

also bootstrap/jquery/angular are libraries and other things of that nature.

Jack Lyons
@JackEdwardLyons
Feb 13 2016 22:08
thanks @pradeepce hmm yeah im not sure whats going on either... i put the values in but i dont think that is the issue
CamperBot
@camperbot
Feb 13 2016 22:08
jackedwardlyons sends brownie points to @pradeepce :sparkles: :thumbsup: :sparkles:
:star: 316 | @pradeepce | http://www.freecodecamp.com/pradeepce
Spencer
@smitchell556
Feb 13 2016 22:23
Just "finished" the weather project. The icons need to be sharpened (I found free ones online that get blurry when scaled up). The icon and background color changes depending on the weather. I'm probably gonna update the javascript to use a switch statement instead of an if/else block. Constructive criticism would be greatly appreciated! my codepen
John Roman
@jrroman
Feb 13 2016 22:28
I am working on the Random quote generator. I have made an object to hold all of my quotes, but i dont know how to make the twitter button post only the quote content. Would i have to $document.getElementById('#tweet') ect.. here is a link to my codepen. http://codepen.io/jrroman/pen/ZQVPXy
any help is very much appreciated
max77p
@max77p
Feb 13 2016 22:33
can someone help me with this, i can't seem to change the color for the navbar text at the top
John Roman
@jrroman
Feb 13 2016 22:35
@max77p in your css try .navbar{ details here}
max77p
@max77p
Feb 13 2016 22:35
@jrroman that doesn't seem to work
John Roman
@jrroman
Feb 13 2016 22:41
@max77p sorry .navbar .nav > li > a{ color:black} for instance
max77p
@max77p
Feb 13 2016 22:41
@jrroman why do i have to go like that?
Elizabeth Fine
@elizabethfinedev
Feb 13 2016 22:44
hey guys, can anyone help me?? I am doing my random quote generator and i cant figure out how to make my "new quote" button do somehting
right now i just want it to print out hi to the console log just so i know it works but its not working
does anyone know how to use java script to make an html button work?
Franco Zapata
@Francozt01
Feb 13 2016 22:48
blob
@max77p
John Roman
@jrroman
Feb 13 2016 22:48
@max77p i misread and thought you were referring to the background of your navbar. You adjust it like that because you are targeting the element you are trying to change.
@max77p did that accomplish what you were looking for?
max77p
@max77p
Feb 13 2016 22:49
@jrroman ohh what is the !important used for?
John Roman
@jrroman
Feb 13 2016 22:51
@max77p it can be used to override inline styling, but where do you see !important?
max77p
@max77p
Feb 13 2016 22:51
@jrroman oh ok thanks!
CamperBot
@camperbot
Feb 13 2016 22:51
max77p sends brownie points to @jrroman :sparkles: :thumbsup: :sparkles:
:star: 272 | @jrroman | http://www.freecodecamp.com/jrroman
John Roman
@jrroman
Feb 13 2016 22:52
@max77p I dont use it because it can become very confusing to me. That is just my opinion though im sure it has its time and place
@max77p thanks! :)
CamperBot
@camperbot
Feb 13 2016 22:52
jrroman sends brownie points to @max77p :sparkles: :thumbsup: :sparkles:
:star: 312 | @max77p | http://www.freecodecamp.com/max77p
Scott
@macengr
Feb 13 2016 23:03
Okay, I've been beating my head against the wall for four days. When my tic-tac-toe game resets, it cleans the board....then for some reason it adds back the most recent move by the player and the most recent move by the computer. I have no idea why. Can someone take a look, please, and see what's going on? This version is not AI, by the way, it just plays a random square. Thanks! http://codepen.io/macengr/full/eJrBvb/
LennixM
@LennixM
Feb 13 2016 23:17
The weather app is so damn frustrating:( You have to create such an app at a point where you know almost nothing about APIs and JSON...
Gabriel
@Zera99
Feb 13 2016 23:50
Hello, is this where I would come to ask some CSS questions? By any chance? I'm kind of stuck with something I want to do