These are chat archives for FreeCodeCamp/HelpFrontEnd

11th
Nov 2016
F22rapt
@F22rapt
Nov 11 2016 00:00
is that a food?
Mitch
@MitchWilkins
Nov 11 2016 00:12
@awb715 add it in the same container
  • I am new to Reactjs.
  • If the staus is active. I need to update the p tag and need to update in my liClass as .sports-last-second
  • .sports-changed-status should be changed to .sports-last-second
  • I have created a if condition but not sure how to insert.
  • Can you guys tell how to do it.
  • Providng my code below.
    newContentAdded: function () {

      var firstTab = 'got-the-value';

    if (firstTab == 'got-the-value')
    {
     <p> got-the-value got-the-value got-the-value got-the-value </p>
    }
    }

working fiddle
https://jsfiddle.net/9e767txs/33/

not working fiddle
https://jsfiddle.net/9e767txs/38/

Bryan Gronberg
@bgronberg91
Nov 11 2016 00:58
hi i'm working on my random quote machine. i'm having trouble implementing a twitter button that updates with each new quote
Tom
@moT01
Nov 11 2016 01:18
@bgronberg91 https://twitter.com/intent/tweet/?text=" + $(".quote").text() + " " + $(".author").text() ---my url
Bryan Gronberg
@bgronberg91
Nov 11 2016 01:21
thanks, i'll try it!
Tom
@moT01
Nov 11 2016 01:21
click my name and say thanks
Bryan Gronberg
@bgronberg91
Nov 11 2016 01:22
@moT01 thanks
CamperBot
@camperbot
Nov 11 2016 01:22
:cookie: 302 | @mot01 |http://www.freecodecamp.com/mot01
bgronberg91 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
Tom
@moT01
Nov 11 2016 01:22
mmm, brownies
hudoodesign
@hudoodesign
Nov 11 2016 01:39
Hi guys, I have a question about Bootstrap. I made a toggleable menu, but using <nav class="navbar navbar-default">, the dropdown in mobile size was transparent and not well positioned. Then I tried <div class="navbar navbar-default"> and the BS classes kicked in. I'm puzzled. Why would changing it to div fix it?
Ellen
@sunsplat
Nov 11 2016 02:05
Maybe divs
In bootstrap have their own styles?
Walid Ashri
@walidashri
Nov 11 2016 02:08
@hudoodesign html5 nav tag has some built in styles
Max Ho
@maxnathaniel
Nov 11 2016 02:12
@hudoodesign open the console and check how the styles are being called. Then you'll know if bootstrap is applying styles to nav or not
Juliana G P S Ferreira
@julianaferry
Nov 11 2016 02:12
Hello
hudoodesign
@hudoodesign
Nov 11 2016 02:12
@walidashri yeah, it's just that the recommendation in the BS documentation shows the nav being used, not the div. Yet when I use nav, the styles are messed up. I've tested it and it's not my custom styles making it that way. I'd use div, except that it's not semantic.
Walid Ashri
@walidashri
Nov 11 2016 02:15
@julianaferry hi
@hudoodesign can u share ur code?
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:21
hey guys im working on my tic tac toe and trying to create a function for my buttons, but i get an error in the console that the event in my function is not define
i have this function
funcTemplate(arr, el, attr, func) {
    return function () {
      return arr.forEach((item) => {
        item = document.createElement(el);
        item.setAttribute("class", attr);
        this.gameBoard.appendChild(item);
        item.addEventListener("click", (e) => {
          func(e); // ==> how do i reference this function
        });
      });
    }
  }
and this to create the game board
let tiles = Array(9).fill();
    let createTiles = this.funcTemplate(tiles, "div", "tile active", this.markTile(e));
    createTiles();
    // this.setTiles();
    this.setPlayerButtons();
and i get an error e is not defined
Max Ho
@maxnathaniel
Nov 11 2016 02:31
@JackEdwardLyons i copied your code onto jsfiddle, and it doesn't throw any error at all. But nothing is displayed too
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:31
yeah, the (e) is not being carried through
how should I reference it?
yeah it should display the tiles
Max Ho
@maxnathaniel
Nov 11 2016 02:32
It's strange that nothing is displayed at all in js fiddle (my trusted editor heh)
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:33
check the console in your browser
it will show up
Max Ho
@maxnathaniel
Nov 11 2016 02:33
have you checked the jsfiddle link i sent you? it doesn't throw any errors in the console
i see the error in codepen but not in jsfiddle
hudoodesign
@hudoodesign
Nov 11 2016 02:35
@walidashri I think it's one of my files that I've got linked on my local machine. I tried using nav on codepen and it worked, so no point in sharing that! I code mostly on my machine because codepen makes it too hard to link files unless you have a premium account with storage...
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:36
strange...
not sure why its not working :(
Walid Ashri
@walidashri
Nov 11 2016 02:37
@hudoodesign nvm just wanted to ckeck
@JackEdwardLyons line 36 this.markTile(e)
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:38
yeah
what should it be? @walidashri
hudoodesign
@hudoodesign
Nov 11 2016 02:39
@walidashri thanks anyway! You were the only one to reply, and I think I'm getting to the bottom of it at last.
CamperBot
@camperbot
Nov 11 2016 02:39
hudoodesign sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
:cookie: 609 | @walidashri |http://www.freecodecamp.com/walidashri
Walid Ashri
@walidashri
Nov 11 2016 02:43
@JackEdwardLyons up to that line e is not defined
@hudoodesign thanks :+1:
CamperBot
@camperbot
Nov 11 2016 02:43
walidashri sends brownie points to @hudoodesign :sparkles: :thumbsup: :sparkles:
:cookie: 121 | @hudoodesign |http://www.freecodecamp.com/hudoodesign
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:44
yeah....
how do I define it?
@walidashri
Walid Ashri
@walidashri
Nov 11 2016 02:48
as I can see from your code is to be added to constructor params then the new game to be called with it; which gonna need to re-arrange all ur code
hudoodesign
@hudoodesign
Nov 11 2016 02:49
@walidashri are you still there? Here's my pen http://codepen.io/Hudoo/pen/oYbexm a question I still have is how to get rid of the black line that shows up when the menu is in mobile mode. I also have this problem that the menu bar changes height to a smaller size.
Jack Lyons
@JackEdwardLyons
Nov 11 2016 02:49
im not sure i understand your answer, sorry @walidashri
hudoodesign
@hudoodesign
Nov 11 2016 02:54
@walidashri if you try changing the nav to div and vice versa, the styles change, which was unexpected. It's supposed to be a black nav bar and it is when div, but when nav it goes light gray.
Walid Ashri
@walidashri
Nov 11 2016 02:54
@JackEdwardLyons
constructor(e)
hudoodesign
@hudoodesign
Nov 11 2016 02:55
@walidashri this .navbar-inverse seems to stop working when it's in a nav element.
Walid Ashri
@walidashri
Nov 11 2016 02:57
@hudoodesign u override the css with this
` nav.navbar { height: 40px; min-height: 65px; background-color: #EEE; ///here }
hudoodesign
@hudoodesign
Nov 11 2016 03:00
@walidashri yes, right you are. I think I need a break. Too much scanning...
thanks!
Jack Lyons
@JackEdwardLyons
Nov 11 2016 03:01
ohh perhaps.... thanks @walidashri -- that solves the not defined problem... but the board doesnt show
CamperBot
@camperbot
Nov 11 2016 03:01
jackedwardlyons sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
:cookie: 610 | @walidashri |http://www.freecodecamp.com/walidashri
Andrii Tynok
@wtfua92
Nov 11 2016 03:12
Hey guys! I hope you all have a good day. I'm currently trying to solve my Random quote machine challenge. is there anyone willing to share a random quote API?
Jack Lyons
@JackEdwardLyons
Nov 11 2016 03:15
ahhh i figured it out
the inner function was preventing "this" from travelling up to the constructor
@wtfua92 posted mine in chat
Jack Lyons
@JackEdwardLyons
Nov 11 2016 03:16
createTiles() {
    let tiles = Array(9).fill();
    return this.funcTemplate(tiles, "div", "tile active", this.markTile);
  }

  funcTemplate(arr, el, attr, func) {
    // removed function from here
      return arr.forEach((item) => {
        item = document.createElement(el);
        item.setAttribute("class", attr);
        this.gameBoard.appendChild(item);
        item.addEventListener("click", (e) => {
          func(e); // ==> how do i reference this function
        });
      });
  }
Andrii Tynok
@wtfua92
Nov 11 2016 03:18
@bgronberg91 thanks. I hope you don't mind if I use the same API, do you?
CamperBot
@camperbot
Nov 11 2016 03:18
wtfua92 sends brownie points to @bgronberg91 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for bgronberg91
Bryan Gronberg
@bgronberg91
Nov 11 2016 03:20
@wtfua92 no that's one that i've seen a lot of campers using
@wtfua92 i didn't implement it perfectly but it works
Aaron Bell
@awb715
Nov 11 2016 03:30
what does everyone think?
Tom
@moT01
Nov 11 2016 03:33
@awb715 search isn't working for me
Aaron Bell
@awb715
Nov 11 2016 03:33
whattt
Tom
@moT01
Nov 11 2016 03:34
yea ive had that feeling
Aaron Bell
@awb715
Nov 11 2016 03:34
it works for me
Tom
@moT01
Nov 11 2016 03:35
lemme check in my chrome
yea it's working over there, ...looks good
Aaron Bell
@awb715
Nov 11 2016 03:36
it works on my chrome and safari
Tom
@moT01
Nov 11 2016 03:37
firefox
looks good though, nice animations
joshandevera
@joshandevera
Nov 11 2016 03:41
how can you stack btn on top of each other. wish to stack my buttons on the contact section. http://codepen.io/joshdv92/pen/ENapZR?editors=1100
Tom
@moT01
Nov 11 2016 03:44
@joshandevera the fb twitter and fcc buttons? you want each on its own line i take it
joshandevera
@joshandevera
Nov 11 2016 03:45
@moT01 yes
Tom
@moT01
Nov 11 2016 03:47
one way, not sure it's the best way, but you can set your div with the buttons in it to have a max-width. that will force them to their own line. you could play around with the display options, display: block might do it
joshandevera
@joshandevera
Nov 11 2016 03:49
how uch will be the max width?
Tom
@moT01
Nov 11 2016 03:50
display block works better i think, tried it
joshandevera
@joshandevera
Nov 11 2016 03:50
can i see your code?
Tom
@moT01
Nov 11 2016 03:51
i gave all the <a> tags a class "buttons"
then in css .buttons { display: block; }
but you will need to play around with the margin/padding
joshandevera
@joshandevera
Nov 11 2016 03:52
@moT01 thanks for the help :)
CamperBot
@camperbot
Nov 11 2016 03:52
joshandevera sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @mot01 |http://www.freecodecamp.com/mot01
Sarahjsts
@Sarahjsts
Nov 11 2016 03:55
sorry to bother you guys but can anyone help me with the tweet button in the random quote machine i can't get it to work
Tom
@moT01
Nov 11 2016 03:55
whats the problem @Sarahjsts
Sarahjsts
@Sarahjsts
Nov 11 2016 03:56
i'm using an api for the random quotes but I can't figure how how to tweet them, when i try I can open up twitter i just can't find a way to get the actual quote in
Tom
@moT01
Nov 11 2016 03:58
https://twitter.com/intent/tweet/?text=" + $(".quote").text() + " " + $(".author").text() ---my url
Here's the code:
$(document).ready(function(){
  var tweetLink = $("#moreText").text;
  $("#tweet").on("click", function(){
window.open('http://twitter.com/intent/tweet?text=' + $('#moreText').text);
  });
});


$(document).ready(function(){
  var box = document.getElementById('text'),
    colors = ['purple', 'yellow', 'orange', 'brown', 'grey'];

document.getElementById('newQuote').onclick = function () {
    color = colors.shift();
    colors.push(color);

    box.style.backgroundColor = color;
}
}) 
$(document).ready(function(){
    $("#newQuote").on("click", function(){
     $.ajax({
      url: 'http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
      success: function(a) {
        $("p").html(a[0].content + "<p>— " + a[0].title + "</p>")
      },
      cache: false
  });
    });
  });
Tom
@moT01
Nov 11 2016 04:02
is it on codepen or ur own editor?
Sarahjsts
@Sarahjsts
Nov 11 2016 04:02
codepen
Tom
@moT01
Nov 11 2016 04:02
put a link to the pen so i can play with it
joshandevera
@joshandevera
Nov 11 2016 04:04
@moT01 how did you make the buttons smaller?
Tom
@moT01
Nov 11 2016 04:06
@Sarahjsts .text()
console.log your tweetLink and you get a jumble
Sarahjsts
@Sarahjsts
Nov 11 2016 04:07
yeah i'm not sure what's wrong
Tom
@moT01
Nov 11 2016 04:07
your syntax is wrong
Sarahjsts
@Sarahjsts
Nov 11 2016 04:07
Ok so what do I do to fix it?
Tom
@moT01
Nov 11 2016 04:08
look at your var tweetlink and look at the link i gave you, and spot the difference
@joshandevera i didn't
i was leaving that up to you
lemme take a look
Tom
@moT01
Nov 11 2016 04:11
you didn't put them like you wanted?
Sarahjsts
@Sarahjsts
Nov 11 2016 04:12
https://twitter.com/intent/tweet/?text=" + $(".quote").text() + " " + $(".author").text() ---my url if you're talking about this you have $(".quote").text() + " " + $(".author").text() but if i put that in my link i can get the link to work but the quote still doesn't go through
Tom
@moT01
Nov 11 2016 04:13
its the .text(), ...you have .text ...i have .text()
Sarahjsts
@Sarahjsts
Nov 11 2016 04:14
ok It seems to be working now
thanks @moT01
CamperBot
@camperbot
Nov 11 2016 04:15
sarahjsts sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 11 2016 04:16
@joshandevera you gotta play around with it, ...if you change them to buttons instead of anchor tags they will be small, but then they aren't centered, bootstrap probly has a class for that
Sarahjsts
@Sarahjsts
Nov 11 2016 04:17
ok... having a new problem now. Now it will only tweet what's in the <p> element and not the quote from the API
Tom
@moT01
Nov 11 2016 04:21
yea
look at what is happening before and after your $("#tweet).on("click")
Sarahjsts
@Sarahjsts
Nov 11 2016 04:25
alright
when i put $("#moreText").text() into the console it works and give me a quote but tweetLink won't define as it. also when i put $("#moreText").text() directly into the window.open it doesn't work
Tom
@moT01
Nov 11 2016 04:31
youre close
Sarahjsts
@Sarahjsts
Nov 11 2016 04:34
got it
thanks again @moT01
CamperBot
@camperbot
Nov 11 2016 04:34
sarahjsts sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: sarahjsts already gave mot01 points
Tom
@moT01
Nov 11 2016 04:37
sure thing, ...the whole tweetLink line can go now
Sarahjsts
@Sarahjsts
Nov 11 2016 04:38
yeah i deleted it
Annu Nirmal
@annunirmal
Nov 11 2016 04:41
can anyone point out my mistake
http://codepen.io/nirmalannu/pen/oYbpmv
Tom
@moT01
Nov 11 2016 04:43
hello again @annunirmal
did you get it? , ...i think it's you didn't add bootstrap to the pen
Annu Nirmal
@annunirmal
Nov 11 2016 04:45
@moT01 yeah right . thanls
Hans Ng
@hans-ng
Nov 11 2016 04:52
Hello all! Could you take a look at my portfolio page: https://hans-ng.github.io/
There’s something I can’t figure out: when hovering to the first portfolio (Tribute Page) the color of the text (Simple responsive…) is changed; but it’s not for the other portfolios (Game of Life and Quote Generator)
Many thanks!
Tom
@moT01
Nov 11 2016 05:00
how do i see the code
@hans-ng
seems like it shouldn't be too hard, ...maybe a class missing in those images or something
Hans Ng
@hans-ng
Nov 11 2016 05:13
@moT01 oh, let me put it into codepen then. I checked my CSS but still can’t figure out :)
phani
@phanicr7
Nov 11 2016 05:15
how to add two classes in a img tag?
Tom
@moT01
Nov 11 2016 05:16
@phanicr7 pretty sure with just a space in between them
<img class="class1 class2"
phani
@phanicr7
Nov 11 2016 05:16
ya i saw just now .. i did like this <img class = " class 1" "class 2"
thnx for answer mot
Tom
@moT01
Nov 11 2016 05:17
click my name and say thanks
Ken Haduch
@khaduch
Nov 11 2016 05:17
@hans-ng - for the first project, it looks like you only have one anchor element that includes the image and the <p>, which is the text for the anchor. The other two you have some sub-level anchor tags for the text, so I think that it is not applying the top-level hover style to those second level anchors until you hover over them.
phani
@phanicr7
Nov 11 2016 05:17
@moT01 haha thank you
CamperBot
@camperbot
Nov 11 2016 05:17
phanicr7 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 305 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 11 2016 05:18
i was hungry
phani
@phanicr7
Nov 11 2016 05:18
i am going through tuts in this website
Hans Ng
@hans-ng
Nov 11 2016 05:18
@khaduch spot on! I’m suspecting it too. How would you suggest to fix it?
Ken Haduch
@khaduch
Nov 11 2016 05:19
@hans-ng - take out those sub-level anchor tags and just put text there? Make it just like the first, if you want it to behave as the first one is doing.
Hans Ng
@hans-ng
Nov 11 2016 05:20
I did that. But I still want to add those sub-level anchor tags… Do you think we have another way?
phani
@phanicr7
Nov 11 2016 05:22
<style> .thick-green-border { border-color :green;
border-width:10px
border-style: solid;}
</style>
and i added this in img tag.. but it wont work
Tom
@moT01
Nov 11 2016 05:24
@hans-ng put the second link after the first one
<p>A colorful...</p></a><a>Wicked</a>
Ken Haduch
@khaduch
Nov 11 2016 05:26

@hans-ng - well, I see upon further inspection that you have three separate anchor tags - you could make the first line of the "caption" be the text of the anchor for the project, and then change the second line to be a separate anchor? Change the text around so that it would show up as:

A colorful game of life</a> <!-- closing the first anchor -->
<a href="wickedlysmart.com" >inspired by WickedlySmart</a>

Maybe that would do? It would then highlight the project name and provide a second link for the other site reference?

Tom
@moT01
Nov 11 2016 05:28
@phanicr7 10px;
Aiden
@AidenMead
Nov 11 2016 05:29
Hey all! So I had a working Weather app, but it was unfinished, I started to add other necessary features and my geolocation as well as the API request that was all working suddenly stopped, so instead of working backwards, I wanted to just start one fresh, but now I can't for the life of me get my geolocation to work again on a new pen
Anyone think they could take a look?
phani
@phanicr7
Nov 11 2016 05:30
@moT01 u are a life saver
@moT01 thanks again
CamperBot
@camperbot
Nov 11 2016 05:30
:warning: phanicr7 already gave mot01 points
phanicr7 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
Tom
@moT01
Nov 11 2016 05:31
@AidenMead i think i copy and pasted the code from the exercise
put link up
Josh
@joshfilippi
Nov 11 2016 05:32
Hello fellow campers,
can anyone help me get this basic animation working? I've followed the steps laid out in the course. I've added the animation.css library . Please help! Thanks
Aiden
@AidenMead
Nov 11 2016 05:33
Yeah, I just want to make sure that I understand the code, which is why I started building a new one instead of just working backwards on the old one. i want to know that I can make it work.
Oh my, I think I know that my issue is... that last question made me realize I never loaded my jQuery library on my new pen, hahahahha
Josh
@joshfilippi
Nov 11 2016 05:34
haha glad i could help
Ken Haduch
@khaduch
Nov 11 2016 05:37
@joshfilippi - put your JS code in the JS panel. That is probably what you need.
Tom
@moT01
Nov 11 2016 05:38
@AidenMead well, like i said, i copy and pasted the code from the exercise, im not sure i understand it enough to troubleshoot what youre doing
Aiden
@AidenMead
Nov 11 2016 05:39
@joshfilippi So from what I found, codepen is a little interesting to use because you don't actually have to tell it that your html document is html, and such, but i've found it works better to code in the boxes provided for each language seperately (instead of adding <script> into the html box, for example. So one I moved everything around and added the /$(document).ready(function(){}\ wrapping your js, it ran fine for me.
Ken Haduch
@khaduch
Nov 11 2016 05:39
@joshfilippi - yes, just put the $("h1").addClass("animated shake"); in the JS panel, so that the jquery code is loaded first, then it will work.
Aiden
@AidenMead
Nov 11 2016 05:39
@moT01 no worries, I realized it was just that I hadn't loaded the jQuery library, a simple issue, haha.
Josh
@joshfilippi
Nov 11 2016 05:39
@khaduch thanks, working. tried that before and didnt work.. must have been doing something wrong
Thank you
CamperBot
@camperbot
Nov 11 2016 05:39
joshfilippi sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1915 | @khaduch |http://www.freecodecamp.com/khaduch
Tom
@moT01
Nov 11 2016 05:39
yea ive been there
it works after that?
Aiden
@AidenMead
Nov 11 2016 05:41
Yep, I've done that probably three or so time, and I'm sure I will do it many more.
Ken Haduch
@khaduch
Nov 11 2016 05:41
@joshfilippi - yes, and @AidenMead is correct about the correct use of codepen - there should only be HTML code in the HTML panel, and that means no <html>, <head>, or <body> tags - all CSS and external libs should be in the CSS panel and config, and same for JS - external libs in the config panel, JS code in the Js panel. Then CodePen plugs it all into a template and generates the page. It just takes a bit of getting used to doing that... good luck!
Aiden
@AidenMead
Nov 11 2016 05:42
^ that's my only complaint about codepen. great to play around with, but teaches a bit of a bad habit with leaving those out.
Ken Haduch
@khaduch
Nov 11 2016 05:50
@AidenMead - it's a helpful environment for the novices - makes it easier to include all of the libs, etc. You do need to know that way to do all of that for a project that doesn't have CodePen's helpful shortcuts and quick-adds...
Tom
@moT01
Nov 11 2016 05:51
anyone do the calculator?
Aiden
@AidenMead
Nov 11 2016 05:52
@khaduch No doubt, I completely agree! It's great to get the hang of the meat of the code and thinking about how to structure everything inside of the mundane and repetitive parts.
Tom
@moT01
Nov 11 2016 05:54
still there @khaduch ?
Hans Ng
@hans-ng
Nov 11 2016 06:08
@khaduch Thank you! I undertood and followed your approach. Still, maybe there’s a way to style multi-level anchor tags… I’m looking into it then.
CamperBot
@camperbot
Nov 11 2016 06:08
hans-ng sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1916 | @khaduch |http://www.freecodecamp.com/khaduch
The console is not logging the correct api it's for the wikipedia thing please help
my jquery code is this:

$(document).ready(function(){
  $("#search").on("click", function(){
    $.ajax({
      type:"GET",
      url:"https://crossorigin.me/https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts%7Cimageinfo&generator=search&exsentences=2&exlimit=20&exintro=1&gsrsearch=dogs",
      dataType:"json",
      success: function(json){
        console.log(json);
      }
    });
  });
});
Tom
@moT01
Nov 11 2016 06:23
@aarya1302 whats the problem, how its giving you the the pages
im seeing what looks like the right stuff, you just need to extract it
look at it in the browsers console
Aarya Bhorra
@aarya1302
Nov 11 2016 06:26
How do I extract the data?
Tom
@moT01
Nov 11 2016 06:28
similar to the Get JSON with the jQuery getJSON Method exercise
Aarya Bhorra
@aarya1302
Nov 11 2016 06:29
Ohh never mind I understand now Thanks @moT01
CamperBot
@camperbot
Nov 11 2016 06:29
aarya1302 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 11 2016 06:29
the one after that actually
sure
Aiden
@AidenMead
Nov 11 2016 06:33
i cannot figure out why this .ajax is failing to retrieve data
 function pullWeather(){
    $.ajax({
      url: "http://api.apixu.com/v1/current.json",
      data: {
        "key": "dcbad7f6861e46a7ac361103161111",
        "q" : coords
      },
      success: (function(){
        $(".results").append("Yay!");
      }),
      error: (function(){
        $(".results").append("Oh no! Something went wrong...");
      })
    });
  }
(my var coords is stored in a global variable and is properly returning the correct coordinates, so that's not it)
Annu Nirmal
@annunirmal
Nov 11 2016 06:36
how can i stop my col to go to next line after 960px screen
http://codepen.io/nirmalannu/pen/oYbpmv
Aiden
@AidenMead
Nov 11 2016 06:37
when I pop that into JSONview, it returns the right data, but I have to manually enter the coordinates, so i'm thinking it's not appending to the url correctly
NITIN RAGHAV
@nitinraghav
Nov 11 2016 07:01
does anybody know a good jQuery and AJAx tutorial. I am currently at random quote machine challenge.
Hans Ng
@hans-ng
Nov 11 2016 07:05
@khaduch I’ve updated my page to break down each portfolio into two sub-sections: the 1st is thumbnail & caption, the 2nd is a brief summary of the portfolio. It seems to be ok for me now. https://hans-ng.github.io/
darisguo
@darisguo
Nov 11 2016 07:08
working on the tribute page: http://codepen.io/jwguo/full/aBdYvp/
somehow the target=_blank just won't work
Hans Ng
@hans-ng
Nov 11 2016 07:12
@darisguo it works for me:
<a href="https://en.wikipedia.org/wiki/Leonard_Cohen" target="_blank"> Learn more</a>
darisguo
@darisguo
Nov 11 2016 07:13
@hans-ng my bad. I didn't save the code... but I set the link to change color after visiting. This one doesn't work.
Hans Ng
@hans-ng
Nov 11 2016 07:23
@darisguo well, again, it works for me. Maybe you saw the same "visited” color on the 2nd try? It means you’ve visited that link already and the browser remembers that.
Try this on another browser or clear the cache of your current one.
darisguo
@darisguo
Nov 11 2016 07:33
@hans-ng Cool. Glad to know that. Thank you!
CamperBot
@camperbot
Nov 11 2016 07:33
:cookie: 268 | @hans-ng |http://www.freecodecamp.com/hans-ng
darisguo sends brownie points to @hans-ng :sparkles: :thumbsup: :sparkles:
evakri
@evakri
Nov 11 2016 08:01
Hey guys, how to make an image fit nicely in a div like in this example?
njwda
@njwda
Nov 11 2016 08:10
@evakri Try setting a min-width to the image to make it responsive.
c0d0er
@c0d0er
Nov 11 2016 08:12
any idea to fix? any idea to fix: after i click any button, then it leaves the blue border and the border is not same width? http://codepen.io/c0d0er/pen/LRKVmE?editors=0010
kirbyedy
@kirbyedy
Nov 11 2016 08:15
@c0d0er
.button:focus {
  outline:0;
}
c0d0er
@c0d0er
Nov 11 2016 08:17
@kirbyedy thanks!
CamperBot
@camperbot
Nov 11 2016 08:17
c0d0er sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1522 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
c0d0er
@c0d0er
Nov 11 2016 08:21
@kirbyedy my calculator this issue: cannot resolve 3.22.2, then back 2 and . and 2 then press 0000 shows 3.20000, should show 3.2*0;, any idea to fix?
kirbyedy
@kirbyedy
Nov 11 2016 08:22
dont know, sorry :(
c0d0er
@c0d0er
Nov 11 2016 08:30
@kirbyedy np!
Sorin Ruse
@sorinr
Nov 11 2016 08:38
@c0d0er it seems it doesn't accept to input 3.22.2
c0d0er
@c0d0er
Nov 11 2016 08:40
@sorinr just fixed, thanks! please check if there is any problems, thanks!
CamperBot
@camperbot
Nov 11 2016 08:40
c0d0er sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 842 | @sorinr |http://www.freecodecamp.com/sorinr
c0d0er
@c0d0er
Nov 11 2016 08:44
if i press 0.002*0.03, then backspace 03, then if i press 0003, i can only press 00, cannot press more, any idea to fix? @sorinr
Sorin Ruse
@sorinr
Nov 11 2016 08:45
@c0d0er i would display a result with decimals zero. lets say you go for 3.05+1.95 that makes 5 and its ok. but iwould display it as 5.00 as long as i had decimal numbers. hope it makes sense
@c0d0er let me check what you said above
@c0d0er i've tried what you said to correct the 0.03 input and make it 0.0003 and it works
c0d0er
@c0d0er
Nov 11 2016 08:51
@sorinr not backspace 0.03 but backspace 03 and leave 0. there and then reclick 03 and you cannot do that
Sorin Ruse
@sorinr
Nov 11 2016 08:52
@c0d0er i can :)
@c0d0er i just deleted 03 decimals and left there 0. then inputed 0003 and it worked
c0d0er
@c0d0er
Nov 11 2016 08:54
so you press 0.02*0.03 first, then back 03, leave 0.02*0., then you press 03 and you cannot do that
i just checked
Sorin Ruse
@sorinr
Nov 11 2016 08:56
@c0d0er did it exactly the way you said and it worked with the result 0.0006
c0d0er
@c0d0er
Nov 11 2016 08:56
@sorinr ok, maybe you are right, i will double check again, thanks!
CamperBot
@camperbot
Nov 11 2016 08:56
c0d0er sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:warning: c0d0er already gave sorinr points
Thayyeb salim
@Thayyebsalim
Nov 11 2016 09:15
so any Tesla lovers here
I've just completed my tribute page for Nikola Tesla
as part of the tribute page project
please check it out, and give reviews.
Thayyeb salim
@Thayyebsalim
Nov 11 2016 09:24
@AidenMead Thank you for the applauds earlier
CamperBot
@camperbot
Nov 11 2016 09:24
thayyebsalim sends brownie points to @aidenmead :sparkles: :thumbsup: :sparkles:
:cookie: 271 | @aidenmead |http://www.freecodecamp.com/aidenmead
Clyde Lobo
@oppiniated
Nov 11 2016 09:28
@Thayyebsalim The timeline is not readable. Change the color of the text from white to something darker
Also the quotes are getting cut off at the bottom
Thayyeb salim
@Thayyebsalim
Nov 11 2016 09:29
@oppiniated sorry I'm not good with making elements responsive
I just made the table responsive
You can get a better view if you switch to full page
I've just made all the changes you wanted @oppiniated
https://codepen.io/Thayyeb_Itachi/pen/rWVrmG
Thank you @oppiniated
CamperBot
@camperbot
Nov 11 2016 09:34
thayyebsalim sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
:cookie: 352 | @oppiniated |http://www.freecodecamp.com/oppiniated
Clyde Lobo
@oppiniated
Nov 11 2016 09:40
@Thayyebsalim Much better now
Thayyeb salim
@Thayyebsalim
Nov 11 2016 09:42
thank you
Ardis Petermans
@Ardis101
Nov 11 2016 10:17
whats wrong with this line --> <button class="project" id="P1"> <a href="https://codepen.io/Ardis101/full/gLppxB/" target="_blank"></a></button> ? its not opening link when I press on it
J Player
@Heyjp
Nov 11 2016 10:25
@Ardis101 you don't need to nest an <a> element inside of a button. I'd stick to just using an <a> element and style it how you want as they are more flexible.
DreCurrency
@drecurrency
Nov 11 2016 10:51
can someone help me on adding a footer in bootstrap ?
Aman saxena
@neille2406
Nov 11 2016 10:51
i cant change the background?can someone help.
DreCurrency
@drecurrency
Nov 11 2016 10:52
@neille2406 whats your code ?
Aman saxena
@neille2406
Nov 11 2016 11:04
how to add a background image?
Sorin Ruse
@sorinr
Nov 11 2016 11:08
@neille2406 add background-image: url(url to the image) to the element you want
Aman saxena
@neille2406
Nov 11 2016 11:08
ya got it
Dhaval Ranavasiya
@metaphorG
Nov 11 2016 12:24
hi i do not want list to display before clicking the google icon
what should i do http://codepen.io/metaphorg/pen/KNVGzB
Sorin Ruse
@sorinr
Nov 11 2016 13:17
@metaphorG you can use opacity: 0 to the elements you want and then animate them to opacity 1
A_A
@Otto-AA
Nov 11 2016 13:17
@metaphorG
#navs:not(.active) > li {
  opacity: 0;
}
@sorinr best timing O_o
Sorin Ruse
@sorinr
Nov 11 2016 13:19
@Otto-AA it doesn't matter. hope its helpful
A_A
@Otto-AA
Nov 11 2016 13:19
:+1:
apbowe
@apbowe
Nov 11 2016 13:30
Hello can someone help me with my project? multiply and divide work after equal, but the add and subtract do not. https://codepen.io/apbowe/pen/vyEXWZ
I've been trying to figure this out for a few days and it has been fustrating.
*frustrating
A_A
@Otto-AA
Nov 11 2016 13:33
@apbowe which function gets called when adding?
nvm
apbowe
@apbowe
Nov 11 2016 13:33
@Otto-AA asGet
A_A
@Otto-AA
Nov 11 2016 13:34
@apbowe not myOperator?
apbowe
@apbowe
Nov 11 2016 13:35
myOperator changes depending on the operation but it works inside of asGets. myOperator is doing the actual calculation
Clyde Lobo
@oppiniated
Nov 11 2016 13:38
@apbowe Works for me
apbowe
@apbowe
Nov 11 2016 13:39
@oppiniated After pressing equal then + or - then an number? It only works for x and / on mine
kirbyedy
@kirbyedy
Nov 11 2016 13:40
you sure + is not working ?
apbowe
@apbowe
Nov 11 2016 13:40
Everyone using the plus after =
A_A
@Otto-AA
Nov 11 2016 13:40
for me it isn't working either
kirbyedy
@kirbyedy
Nov 11 2016 13:40
ah right, after the =
so on actual result you want + or -
apbowe
@apbowe
Nov 11 2016 13:41
Yes. It works after x or /. Just not + or -. Can't figure out why. I am losing a value in the array
A_A
@Otto-AA
Nov 11 2016 13:42
@apbowe should ["+", 2] be arr in asGet -> else ?
apbowe
@apbowe
Nov 11 2016 13:44
@Otto-AA from what I can tell the array loses the equal value say x. so it should be [x + 2] but for some reason the x isn't being pushed, and I'm pretty sure I put it in there. Something may be overriding it. idk
A_A
@Otto-AA
Nov 11 2016 13:45
at which line would you push it?
apbowe
@apbowe
Nov 11 2016 13:46
@Otto-AA at 102 i think. myArray = myContainer. So in my mind the that should be the arr variable.
A_A
@Otto-AA
Nov 11 2016 13:48
@apbowe btw, what does mdGet stand for?
apbowe
@apbowe
Nov 11 2016 13:50
@Otto-AA multiply divide. That function does all the multiplying and dividing in the array so the calculator performs order of operations. Then it spits out a new array with all the totals, addition, subtraction and untouched numbers.
@Otto-AA so asGet performs those operations but if it is only an array length of one, it just passes that answer.
A_A
@Otto-AA
Nov 11 2016 13:56
@apbowe myArray gets something like [6, 6, "+", "3"]
so there's an thing missing
/theres a 6 too much
apbowe
@apbowe
Nov 11 2016 13:58
@Otto-AA yes. There may be a resetting issue. But I don't understand since its kind of the same code I used for mdGet and that seems to be fine. I've experienced similar results when I've played with it before.
A_A
@Otto-AA
Nov 11 2016 13:59
@apbowe I'll give it a look
apbowe
@apbowe
Nov 11 2016 13:59
@Otto-AA The other weird part is if you turn mdGet off, then the plus and minus DO work after equal.
A_A
@Otto-AA
Nov 11 2016 14:05
@apbowe add myArray = []; to the end of the mdGet function :)
apbowe
@apbowe
Nov 11 2016 14:07
@Otto-AA which line did you add it? 83?
A_A
@Otto-AA
Nov 11 2016 14:07
@apbowe of asGet*
@apbowe

      myArray = [];
    }
  }

  asGet(myArray);
apbowe
@apbowe
Nov 11 2016 14:12
@Otto-AA Thanks for your help! It does work for adding and subtracting. It didn't seem to work if you multiply or divide before it. I'll have to look into it some more. It's a good first step. I have to go to work now but I appreciate the time you took to help me! If you do figure it out just mention me in the answer.
CamperBot
@camperbot
Nov 11 2016 14:12
apbowe sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 370 | @otto-aa |http://www.freecodecamp.com/otto-aa
apbowe
@apbowe
Nov 11 2016 14:15
@Otto-AA nvm. I figured it out. You need one in the if statement at the top of asGet as well. Works like a dream now.
@Otto-AA Thanks man! I really do appreciate it!!!
CamperBot
@camperbot
Nov 11 2016 14:15
apbowe sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:warning: apbowe already gave otto-aa points
A_A
@Otto-AA
Nov 11 2016 14:15
@apbowe you're welcome =D
TasmaniaKrama
@TasmaniaKrama
Nov 11 2016 14:19

function updateInventory(arr1, arr2) {
   var current = {};
   for (var i=0;i<arr1.length;i++) {
       current[arr1[i][1]] = arr1[i][0];
   }
   for (i=0;i<arr2.length;i++){
   if (current.hasOwnProperty(arr2[i][1])) {
       current[arr2[i][1]] = current[arr2[i][1]] + arr2[i][0];
   }
   else {
       current[arr2[i][1]] = arr2[i][0];
   }
   }
return Object.keys(current).map(function(val) { return [current[val],val] });



}




updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]);
Could someone tell me how to return the array so that there is space after comma after each array?
Sorin Ruse
@sorinr
Nov 11 2016 14:21
@apbowe you are complicating all your life. so you can just add to the input #display all the numbers and operators and when you hit "=" just use eval(of the value of the input). here what i'm trying to say: example Don't look at design part coz its not mine and its less important
apbowe
@apbowe
Nov 11 2016 14:23
@sorinr I will take a look. thanks
CamperBot
@camperbot
Nov 11 2016 14:23
apbowe sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 843 | @sorinr |http://www.freecodecamp.com/sorinr
Alex
@Joshua-A-Smith
Nov 11 2016 14:36
How do I set a background image on css btw Im using a encoded image from google images
Spyrantis Theodoros
@thodorisanta
Nov 11 2016 14:41

so im doing the : "Sum All Numbers in a Range" https://www.freecodecamp.com/challenges/sum-all-numbers-in-a-range
Project.

and my code is this:


function sumAll(arr) {
  var max = Math.max(arr[0],arr[1]);
  var min = Math.min(arr[0],arr[1]);

  var sum = 0;
  for(min;min<max+1;min++){
    sum += min;
  }
  return sum;
}

sumAll([1, 4]);

which works great but im not using the "Array.prototype.reduce()" method which is recomended in the "helpfull links". how can i do it with "Array.prototype.reduce()" ? And is it wrong if i let it like i already did it?

Spyrantis Theodoros
@thodorisanta
Nov 11 2016 14:51
@oppiniated did. and i still dont get it.
Clyde Lobo
@oppiniated
Nov 11 2016 14:51
@thodorisanta What part do you not get?
Spyrantis Theodoros
@thodorisanta
Nov 11 2016 14:56
@oppiniated Still not understandable. the project gives me 2 numbers like "[1,4]" and i need to find the sum for all the middle numbers as well. How is that possible with "Array.prototype.reduce()"?
TasmaniaKrama
@TasmaniaKrama
Nov 11 2016 14:59
Nobody knows how to help? It's shame since the code works but freecodecamp console is bugged and it doesn't want to accept it.
Sorin Ruse
@sorinr
Nov 11 2016 15:02
@TasmaniaKrama what is the error into the console?
TasmaniaKrama
@TasmaniaKrama
Nov 11 2016 15:04
The solution it correct but it doesn't want to approve it because of spaces missing after commas separating nested arrays
Carl
@carlm7
Nov 11 2016 15:04
Hi all, rather than use bootstrap tabs I decided to build my own navigation bar and I’m just wondering how to make it collapse on mobiles. Anyone point me in the right direction please? http://codepen.io/carlm7/pen/GNpvrZ
TasmaniaKrama
@TasmaniaKrama
Nov 11 2016 15:05
[[2, "Hello"], [4," Greetings"]]; <-- this is what it wants but this is my output [[2, "Hello"],[4," Greetings"]];
@sorinr and I don't know how to put the spaces inbetween
angelos3lex
@angelos3lex
Nov 11 2016 15:22
@carlm7 What do you mean collapse?
Carl
@carlm7
Nov 11 2016 15:22
@angelos3lex All good I fixed it :) thanks
CamperBot
@camperbot
Nov 11 2016 15:22
:cookie: 146 | @angelos3lex |http://www.freecodecamp.com/angelos3lex
carlm7 sends brownie points to @angelos3lex :sparkles: :thumbsup: :sparkles:
angelos3lex
@angelos3lex
Nov 11 2016 15:23
Great ;)
Ken Haduch
@khaduch
Nov 11 2016 15:25
Aman saxena
@neille2406
Nov 11 2016 15:26
is it fine if i start learning javascript and php side by side?
angelos3lex
@angelos3lex
Nov 11 2016 15:27
@TasmaniaKrama what about console.log(current[val]+" ",val)
somehow like this
Kaeside Iwuagwu
@kaeside
Nov 11 2016 15:28
Hey everyone I am playing around with getting a deeper understanding of the this keyword. I am working on this accordion list and I am trying to expand this list when I click on an li tag which is the parent of the make name Honda or by clicking on a tag. http://jsbin.com/lekebo/edit?html,css,js,output
angelos3lex
@angelos3lex
Nov 11 2016 15:29
@neille2406 Just do not get confused by the different syntax ;)
And generally, after you learn a language,make some projects on it, do not just learn them but not know how to use them very well..Because many people know a lot of different languages/frameworks but they do not know any of them really well
Kaeside Iwuagwu
@kaeside
Nov 11 2016 15:29
so far I have it working to expand when I click on the a tag but I also want it to expand and collapse when I click on its parent as well
Hans Ng
@hans-ng
Nov 11 2016 15:29
@khaduch Thank you :)
CamperBot
@camperbot
Nov 11 2016 15:29
hans-ng sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1917 | @khaduch |http://www.freecodecamp.com/khaduch
Aman saxena
@neille2406
Nov 11 2016 15:30
thanks @angelos3lex
CamperBot
@camperbot
Nov 11 2016 15:30
:cookie: 147 | @angelos3lex |http://www.freecodecamp.com/angelos3lex
neille2406 sends brownie points to @angelos3lex :sparkles: :thumbsup: :sparkles:
Aman saxena
@neille2406
Nov 11 2016 15:31
@angelos3lex could u tell me some projects on html and css?
Hans Ng
@hans-ng
Nov 11 2016 15:32
I have one question: what formula to calculate analogous colors in hex? Or converting from hex to hsl then changing its degrees is the only solution?
j1417
@j1417
Nov 11 2016 15:32
Hi!! why does the twitch's page never loads when i click offline?https://codepen.io/Juan1417/pen/jVbzJy
angelos3lex
@angelos3lex
Nov 11 2016 15:32
Haven'e you done the 2 projects mentioned here on FCC? I suppose they are enough... THe more you want to know them, the better portfolio you have to do..
But html and css are something very basic, so alone you can;t make something Big. Learn JS and Jquerry and then you can play with them very well
Aman saxena
@neille2406
Nov 11 2016 15:33
ok
angelos3lex
@angelos3lex
Nov 11 2016 15:38
@j1417 Maybe their problem?
@kaeside which parent do you mean? I do not understand
j1417
@j1417
Nov 11 2016 15:39
@angelos3lex , mmm.... i think that is not their problem because if i write www.twitch/freecodecamp in a new tab it works perfectly
Clyde Lobo
@oppiniated
Nov 11 2016 15:39
@thodorisanta can you provide me with a link of the challenge with what you have tried?
Sorin Ruse
@sorinr
Nov 11 2016 15:39
@TasmaniaKrama that space between arrays don't matter. the problem is somewhere else. witch point from 1-6 from the challenge u don't pass ?
j1417
@j1417
Nov 11 2016 15:41
@hans-ng Maybe passing hex to binary and then decimal?
Sorin Ruse
@sorinr
Nov 11 2016 15:42
@j1417 its a sandbox problem. if you copy paste same link you open into another new tab it will work
angelos3lex
@angelos3lex
Nov 11 2016 15:43
@j1417 you are right...
j1417
@j1417
Nov 11 2016 15:43
@sorinr How can i fix that??
Kaeside Iwuagwu
@kaeside
Nov 11 2016 15:44
@angelos3lex in the link below, I am targeting the a tag. when the user clicks the a tag I want the list to expand. that is what I currently have working. I also want the list to expand when i target the li with a class of .hasSubs
angelos3lex
@angelos3lex
Nov 11 2016 15:44
@j1417 trying from another site like http://jsbin.com/ or something like this maybe fix it?
Hans Ng
@hans-ng
Nov 11 2016 15:45
@j1417 Could you elaborate? I got lost in the color wheel literally :)) moving one point to another one next to it in the wheel seems easy but what about using hex? Can we minus or plus some constant to get there?
Clyde Lobo
@oppiniated
Nov 11 2016 15:46
@thodorisanta I understood the challenge
Will pm you
Sorin Ruse
@sorinr
Nov 11 2016 15:46
@j1417 i'm afraid you can't if you open the twitch channel using an a tag target _blank. i did it this way :twitch
angelos3lex
@angelos3lex
Nov 11 2016 15:56
@kaeside <li class="hasSubs">Honda</li> <ul> ..... and on your jquerry $('li.hasSubs').click(function(){
or you need honda to be an <a>?
Kaeside Iwuagwu
@kaeside
Nov 11 2016 15:57
yes i need honda to be an a
F22rapt
@F22rapt
Nov 11 2016 15:57
can i perhaps get a little feedback on what i have so far? http://codepen.io/f22rapt/full/GjbgXK/
Spyrantis Theodoros
@thodorisanta
Nov 11 2016 15:57

HOW CAN I MAKE THIS WORK? :

Compare two arrays and return a new array with any items only found in one of the two given arrays, but not both. In other words, return the symmetric difference of the two arrays.

function diffArray(arr1, arr2) {
  var newArr = arr1.concat(arr2);
  // Same, same; but different.
  var newNew = [];
  for(var i=0;i<newArr.length;i++){
    for(var j=0;j<newArr.length;j++){
      if(newArr[i]==newArr[j]){
        newNew[i] += newArr[i];
      }
    }
  }
  return newNew;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
angelos3lex
@angelos3lex
Nov 11 2016 15:58
@kaeside <li class="hasSubs">
<a>Honda</a></li>
Kaeside Iwuagwu
@kaeside
Nov 11 2016 15:59
@angelos3lex I don't think that will work for me because I have a submenu which is a child of the li
angelos3lex
@angelos3lex
Nov 11 2016 16:00
@F22rapt which is your prob?
Kaeside Iwuagwu
@kaeside
Nov 11 2016 16:00
the structure is as follows
<li class="hasSubs">
                <a href="#">Honda</a>
                <ul class="submenu">
                    <li>
                        <a href="#">Accord</a>
                    </li>
                    <li>
                        <a href="#">CRV</a>
                    </li>
                </ul>
            </li>
F22rapt
@F22rapt
Nov 11 2016 16:01
i dont have one..yet. I'm not good with design so was maybe just looking for some feedback if there are ways to improve the layout?
Kaeside Iwuagwu
@kaeside
Nov 11 2016 16:01
if i wrap the a in it's parent li then it breaks the functionality of the accordion list
angelos3lex
@angelos3lex
Nov 11 2016 16:02
add a picture, contact form, contact information, maybe some caption text on your projects, or play with hover on your photos etc
change font-families
@kaeside So just like that?
$('li').click(function(){
  //Expand or collapse this panel
  $(this).children().next(). etc
Kaeside Iwuagwu
@kaeside
Nov 11 2016 16:09
YOOOOO!
@angelos3lex awesome man!
You have no idea how long I was playing with trying to understand it haha
I was trying this.parent and this.siblings before
angelos3lex
@angelos3lex
Nov 11 2016 16:14
$(this) is the one clicked, so its children() is <a> and then <a> next() is the list you want
Happy i helped ;)
angelos3lex
@angelos3lex
Nov 11 2016 16:19
@thodorisanta no need for for inside for.. you just want one for as you have one-dimenssional arrays
Spyrantis Theodoros
@thodorisanta
Nov 11 2016 16:20
@angelos3lex yeah i did two to check for duplicate number :)
angelos3lex
@angelos3lex
Nov 11 2016 16:26
@thodorisanta i mean your code must be somehow like this: function diffArray(arr1, arr2) {
//var newArr = arr1.concat(arr2);
// Same, same; but different.
var newNew = [];
for(var i=0;i<arr1.length;i++){
if(arr1[i]==arr2[i]){
newNew[i] = arr1[i];
}
}
return newNew;
}
console.log(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]));
ah sorry you have different sized arrays so what i am sending you will not work
just ignore it
angelos3lex
@angelos3lex
Nov 11 2016 16:32

@thodorisanta check this:

function diffArray(arr1, arr2) {

// Same, same; but different.
var newNew = [];
for(var i=0;i<arr1.length;i++){
//if(arr1[i]==newArr[i] )
for(var j=0;j<arr2.length;j++){
if(arr1[i]==arr2[j]){
newNew[i] = arr1[i];
}
}
}
return newNew;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

WHat it does:
For every element of arr1, it searches the whole arr2 and if they are equal, then added to newNew
Spyrantis Theodoros
@thodorisanta
Nov 11 2016 16:35
@angelos3lex this sends the identical numbers between the arrays. we want the oposite of that though :P but i will prolly find the way
angelos3lex
@angelos3lex
Nov 11 2016 16:36
That's easy i let it for you ;)
Spyrantis Theodoros
@thodorisanta
Nov 11 2016 16:37
@angelos3lex okay thanks :)
CamperBot
@camperbot
Nov 11 2016 16:37
thodorisanta sends brownie points to @angelos3lex :sparkles: :thumbsup: :sparkles:
Thayyeb salim
@Thayyebsalim
Nov 11 2016 16:37
i need a little help
CamperBot
@camperbot
Nov 11 2016 16:37
:cookie: 148 | @angelos3lex |http://www.freecodecamp.com/angelos3lex
Thayyeb salim
@Thayyebsalim
Nov 11 2016 16:38
<li style="float:right"><a style="pointer-events:none">Thayyeb Salim</a></li>
I need float:none at 600px screen
Tyler Moeller
@TylerMoeller
Nov 11 2016 17:20

@Thayyebsalim You'll need to use CSS to accomplish that:
HTML:

<li class="my-list-item"><a class="no-pointer">Thayyeb Salim</a></li>

CSS:

.my-list-item {
  float: right;
}

.no-pointer {
  pointer-events: none;
}

@media (max-width: 600px) {
  .my-list-item {
    float: none;
  }
}
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Nov 11 2016 17:40
to get explore
Cooper
@tsalta
Nov 11 2016 18:11
how would i center an img?
Sorin Ruse
@sorinr
Nov 11 2016 18:19
@tsalta depends on where and how do you want it centered
Giannis Poulis
@ioanniswd
Nov 11 2016 18:19
Need help with wikipedia api user agent header (From intermediate projects).Not sure what it should contain.I get this error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource".Been stuck for 3 days now.
Tyler Moeller
@TylerMoeller
Nov 11 2016 18:37
@tsalta Add the class center-block to your image:
<img class="center-block" src="https://media1.britannica.com/eb-media/31/1331-004-C2E95422.jpg" alt="Hubble Space Telescope in the cargo bay of the orbiting space shuttle Discovery (STS-82)">
Tyler Moeller
@TylerMoeller
Nov 11 2016 18:46
@ioanniswd You are hitting a CORS issue, add &callback=? to your URL, for example:
var url = 'https://en.wikipedia.org/w/api.php?action=opensearch&callback=?&search=' + searchTerm
Giannis Poulis
@ioanniswd
Nov 11 2016 18:49
@TylerMoeller Will it work if I add it at the end of the URL? Should I use $.getJSON , $.ajax request?
Tyler Moeller
@TylerMoeller
Nov 11 2016 18:51
@ioanniswd It should work anywhere in the URL. The url I gave is meant for $.getJSON. If you use $.ajax, don't use the callback=?, you can use dataType: 'jsonp' instead.
  $.ajax({
    dataType: 'jsonp',
    url: url,
  })
Giannis Poulis
@ioanniswd
Nov 11 2016 18:51
ty @TylerMoeller
CamperBot
@camperbot
Nov 11 2016 18:51
ioanniswd sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 927 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Nov 11 2016 18:51
Good luck, it's a fun project
Thinh Cao
@tcao2
Nov 11 2016 19:05
I am working on the Twitch project and having some issues:
function loadStreams(){
  for (var i = 0; i < channel_list.length; i++){
    offlineName = channel_list[i];
    console.log("offline name is: " + offlineName);
    URL = "https://wind-bow.hyperdev.space/twitch-api/streams/" + channel_list[i] + "?callback=?";
     $.getJSON(URL, function(data){
       console.log("Now offline name is: " + offlineName);
       console.log(data);
       if (data.stream !== null){
         currChannel = new Channel(data.stream.channel.display_name, data.stream.channel.status);
       }
       else {
         currChannel = new Channel(offlineName, "Offline");
       }       
       outArr.push(currChannel);
    });    
  }
}
when the channel is offline, i will create a channel object whose name is the same as the current object in my channel_list
but after the code has gone through the entire array, at the end, the offline channels' names are all the same as the last element in "channel_list"
i've been staring at it for a while
Huargh
@Huargh
Nov 11 2016 19:21
ok, I'll try the forum
christianflorez
@christianflorez
Nov 11 2016 19:21
Hey guys, how do I change the color of .text-primary in CodePen? I just started working on the first project and I can't seem to tell why it's only changing <h2> but not <h1>
Corey Vincent
@CoreyVincent
Nov 11 2016 19:27
Where can I get the api to share something on twitter?
Kaeside Iwuagwu
@kaeside
Nov 11 2016 19:51
hey @angelos3lex are you still around?
Magnus
@magnus195
Nov 11 2016 19:57
Hey. I can't center my row, I cant even load the pictures. Can someone tell me what i did wrong? https://codepen.io/magnus195/pen/KgEQqE
Kaeside Iwuagwu
@kaeside
Nov 11 2016 20:00
@christianflorez try targeting .container-fluid as opposed to.jumbotron
@christianflorez
.container-fluid h1 {
color: white;
}
Ian Lee
@asparism
Nov 11 2016 20:04
@magnus195 not sure, but i did catch two semicolons on the border color of img-tribute class
Thayyeb salim
@Thayyebsalim
Nov 11 2016 20:06
thank you @TylerMoeller
CamperBot
@camperbot
Nov 11 2016 20:06
:cookie: 928 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
thayyebsalim sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
Magnus
@magnus195
Nov 11 2016 20:07
Thank you @asparism .
CamperBot
@camperbot
Nov 11 2016 20:07
magnus195 sends brownie points to @asparism :sparkles: :thumbsup: :sparkles:
:cookie: 298 | @asparism |http://www.freecodecamp.com/asparism
Jamal
@jmal713
Nov 11 2016 20:19
Hey guys quick question for the "Build a Tribute Page " can i create my own page or do i have to follow the instruction?
Ghost
@ghost~56ef2a8b85d51f252ab9dec9
Nov 11 2016 20:24
@jmal713 You can create your own tribute page, you just have to do all the user stories :)
Jamal
@jmal713
Nov 11 2016 20:24
@thomlom Thank You!
CamperBot
@camperbot
Nov 11 2016 20:24
jmal713 sends brownie points to @thomlom :sparkles: :thumbsup: :sparkles:
:cookie: 423 | @thomlom |http://www.freecodecamp.com/thomlom
Daniel
@Cpt-danny01
Nov 11 2016 20:29
hello world ! I'm daniel and my friend recommended this site for me to continue coding and hope to have a great experience with all..Thanks
CamperBot
@camperbot
Nov 11 2016 20:29

welcome to FreeCodeCamp @Cpt-danny01!

Ghost
@ghost~56ef2a8b85d51f252ab9dec9
Nov 11 2016 20:31
Hello @Cpt-danny01 ! With all the projects and challenges, you won't be disappointed! ;)
Jamal
@jmal713
Nov 11 2016 20:47
can i use use HTML5 and CSS from my previous challenge as a note to build the tribute page?
Daniel
@Cpt-danny01
Nov 11 2016 20:53
Thanks @thomlom
CamperBot
@camperbot
Nov 11 2016 20:53
cpt-danny01 sends brownie points to @thomlom :sparkles: :thumbsup: :sparkles:
:cookie: 424 | @thomlom |http://www.freecodecamp.com/thomlom
Aman saxena
@neille2406
Nov 11 2016 20:55
can anyone tell me how to start with git and learn it?
Annu Nirmal
@annunirmal
Nov 11 2016 21:11
Can anyone help me find out why my 'font awesome icons' are not in center of the div
http://codepen.io/nirmalannu/pen/oYbpmv?editors=1100
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:26

Good afternoon everyone. I’m still struggling pretty hard on this geolocation for the weather app. I thought if I created a function that called the user’s city and returned a variable with that text in it, I could put it into my url from Openweathermap… I can either get my page to load from one location that I specify or just not function at all. Can anyone help out? My sketchy code here

$.getJSON('http://ip-api.com/json',function(jg) {
  var city = jg.city;


$.getJSON('http://api.openweathermap.org/data/2.5/weather?q='+city+'&appid=b1b15e88fa797225412429c1c50c122a1',function(jd)

http://codepen.io/djangoearnhardt/pen/dOGxVL

Stephen James
@sjames1958gm
Nov 11 2016 21:34
@djangoearnhardt alert(Please allow GeoLocating); This code is keeping it from running at all
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:35
sorry i’m doing some messing around while I was seeing if anyone could reply… that was just a test of an if statement
it’s back to what I had it @sjames1958gm
Stephen James
@sjames1958gm
Nov 11 2016 21:38
@djangoearnhardt Is your appid value? I am seeing 401 unauthorized errors
Adam Pinsky
@adampinsky
Nov 11 2016 21:38
hello camp! Is there anyone online familiar with Animate.css who could help me with some implimentation?
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:39
@sjames1958gm my thought was to run this code, and return my city name… http://codepen.io/djangoearnhardt/pen/WorVaO and then add it into my api
what do you mean is my appid value? sorry i don’t follow yet @sjames1958gm
Stephen James
@sjames1958gm
Nov 11 2016 21:40
There is an appid in the openweather URL - you have to get your own id from the site
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:41
I thought i did? b1b15e88fa797225412429c1c50c122a1
which is the tail end of my url in $.getJSON('http://api.openweathermap.org/data/2.5/weather?q='+city+'&appid=b1b15e88fa797225412429c1c50c122a1',function(jd)
Tiago Fuelber
@TiagoFuelber
Nov 11 2016 21:46
anyone can take a look at my portfolio. https://codepen.io/tfuelber/full/mArpZL/ the problem is with the bootstrap toggle navbar. It isnt working when collapsed. I dont know why, i've checked other projects and tutorials, with no effect.
kirbyedy
@kirbyedy
Nov 11 2016 21:49
@TiagoFuelber you have to load the bootstrap library
in the JS section, after jquery
Stephen James
@sjames1958gm
Nov 11 2016 21:50
@djangoearnhardt Is that an id you got for yourself from openweather site?
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:50
yes, i signed up there @sjames1958gm
Ed
@edyiot
Nov 11 2016 21:50
can't figure out how to center bullets with ul ?
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:50
well here is my api key 43570f3ce225106d3f5ffafe9e44cc60
Stephen James
@sjames1958gm
Nov 11 2016 21:51
@djangoearnhardt That string should be in the URL not the one above
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:51
man I’m really stupid @sjames1958gm
Tiago Fuelber
@TiagoFuelber
Nov 11 2016 21:51
@kirbyedy great!!!!! It worked. Thanks
CamperBot
@camperbot
Nov 11 2016 21:51
tiagofuelber sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1526 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:52
does the location now work from your end? @sjames1958gm I updated it
Stephen James
@sjames1958gm
Nov 11 2016 21:52
@djangoearnhardt Don't beat yourself up -
yep
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:53
!!!!!!!!! :smile: Thank you so much @sjames1958gm
CamperBot
@camperbot
Nov 11 2016 21:53
djangoearnhardt sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 4313 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:56
@sjames1958gm what would I do to ask the user to allow geolocating? I looked at my page from my phone and it’s telling me im in texas… so I’m not quite there I think
Stephen James
@sjames1958gm
Nov 11 2016 21:57
@djangoearnhardt Are you near Texas?
@djangoearnhardt If you use ip-api.com - your are going to use your ip address which might vary more on your phone - but likely not all the way from Colorado to texas :)
@djangoearnhardt There are ways you can check if you are on chrome, and if you are using https:// and then use the geoLocation API
djangoearnhardt
@djangoearnhardt
Nov 11 2016 21:59
I’m in Aspen lol
@sjames1958gm
That makes sense.
Dylan Moreland
@dylanm312
Nov 11 2016 22:01
Hey guys, I'm doing the tribute page project, and I can't figure out how to center-align my timeline UL (text-align: center leaves the bullet point off to the left). Here's the codepen: https://codepen.io/dylanm312/pen/edwYEm
Ed
@edyiot
Nov 11 2016 22:05
@dylanm312 I'm having the same problem! can't figure it out
I tried to center them ul {
text-align: center;
list-style-position: inside;
display: inline-block;
}
but they're not aligned
What do you thik about this?
Dylan Moreland
@dylanm312
Nov 11 2016 22:15
It's a different way of doing it, and it looks fine, but I'd rather have it centered
Ed
@edyiot
Nov 11 2016 22:16
if you do it, please, let me know too
Dylan Moreland
@dylanm312
Nov 11 2016 22:16
@edyiot will do
@edyiot I DID IT
make a class to select your ul
then .some-class {list-style-position: inside}
Ed
@edyiot
Nov 11 2016 22:19
@dylanm312 thanks!!!
CamperBot
@camperbot
Nov 11 2016 22:19
edyiot sends brownie points to @dylanm312 :sparkles: :thumbsup: :sparkles:
:cookie: 148 | @dylanm312 |http://www.freecodecamp.com/dylanm312
Homer Allen
@homerallen
Nov 11 2016 23:08
Question: Where is the best place to host the picture for the portfolio page?
(I'm guessing you can't upload it somehow onto codepen)