These are chat archives for FreeCodeCamp/HelpFrontEnd

3rd
Jan 2018
Gersho
@Gersho
Jan 03 2018 00:00
@kerafyrm02 that's very elegant
David Belmares
@DavidBelmares
Jan 03 2018 00:00
@kerafyrm02 but i can't see how that remove falsy values
kerafyrm02
@kerafyrm02
Jan 03 2018 00:00
i just showed you
it only returns true values
David Belmares
@DavidBelmares
Jan 03 2018 00:00
I see the code but I don't understand why it works
kerafyrm02
@kerafyrm02
Jan 03 2018 00:00
filter only returns true values
David Belmares
@DavidBelmares
Jan 03 2018 00:01
hmm ok
kerafyrm02
@kerafyrm02
Jan 03 2018 00:01
so if it's false it doesnt return it
since val represents each element in the array
Gersho
@Gersho
Jan 03 2018 00:01
but wouldn't your code return the false value rather than returning the true ones ? @kerafyrm02
kerafyrm02
@kerafyrm02
Jan 03 2018 00:02
nope. works like this
Gersho
@Gersho
Jan 03 2018 00:02
i'm a bix perplexed, guess i drank too much xD
David Belmares
@DavidBelmares
Jan 03 2018 00:02
@kerafyrm02 @Gersho thanks for your help
CamperBot
@camperbot
Jan 03 2018 00:02
davidbelmares sends brownie points to @kerafyrm02 and @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @kerafyrm02 |http://www.freecodecamp.org/kerafyrm02
:cookie: 550 | @gersho |http://www.freecodecamp.org/gersho
kerafyrm02
@kerafyrm02
Jan 03 2018 00:02
var x = [ false, '', 'a'];
val starts off being false... return (false); which means filter doesnt return it
then it does return ('') which is false
Gersho
@Gersho
Jan 03 2018 00:03

function bouncer(arr) {

  function myFilter(item) {
  if (item !== false || item !== null || item !==0 || item !=="" || item !==undefined|| !isNaN) { 
    return item;
  }

    return;
    }

var filtered = arr.filter(myFilter);

  return filtered;
}

bouncer([7, "ate", "", false, 9, null, undefined, NaN]);
here's mine in case you want to compare
kerafyrm02
@kerafyrm02
Jan 03 2018 00:03
then it does return ('a') which is true
so it returns a
kerafyrm02
@kerafyrm02
Jan 03 2018 00:03
you dont need myFilter function
Gersho
@Gersho
Jan 03 2018 00:03
i've written long ago :3
kerafyrm02
@kerafyrm02
Jan 03 2018 00:03
false,null,NaN,undefined are all false
so filter returns false on them all
whicih means it doesnt return that value
Gersho
@Gersho
Jan 03 2018 00:04
and it uses similar structure as @DavidBelmares version so it's ok for him to have a look
kerafyrm02
@kerafyrm02
Jan 03 2018 00:05
btw
!isNaN() doesnt check if a number is NaN
Rajat
@rajataudichya
Jan 03 2018 00:34
can someone direct me to a good php group on gitter
Cade
@CStombaugh
Jan 03 2018 01:06
has anyone ever had trouble importing a javascript file into html? I'm working on a calculator and it functions great in codepen but when I tried to type it up in my editor and open it in chrome all the functionality...well nothing functions, looks just fine though
Alfonso Lamadrid
@almdrx
Jan 03 2018 01:09
Hello Everyone, best wishes for this new year
@CStombaugh could you share the html as a gist?
Cade
@CStombaugh
Jan 03 2018 01:11
Yeah, hopefully this copy and paste doesn't totally ruin the formatting

<head>
<link rel = 'stylesheet' href = 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css'>
<link rel = 'stylesheet' href = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'>
<link rel = 'stylesheet' type = 'text/css' href = 'calc.css'>
<script type = 'text/javascript' src = 'calc.js'></script>
<script type = 'text/javascript' src= 'jquery-3.2.1.slim.min'></script>
<title>JS Calculator</title>
</head>

<body>
<div class = 'text-center'>
<h1>JavaScript Calculator</h1>
<h2>By: Cade Stombaugh</h2>
</div>
<div id = 'output'>
<span id = 'steps'>0</span>
<hr/>
</div>
<div class = 'text-center' id = 'calculator'>
<a class = 'btn btn-danger' id = 'deleteAll'>AC</a>
<a class = 'btn btn-danger' id = 'backOne'>CE</a>
<a class = 'btn btn-primary' id = '/'>/</a>
<a class = 'btn btn-primary' id = '*'>*</a>
<br/>
<a class = 'btn btn-primary' id = '7'>7</a>
<a class = 'btn btn-primary' id = '8'>8</a>
<a class = 'btn btn-primary' id = '9'>9</a>
<a class = 'btn btn-primary' id = '-'>-</a>
<br/>
<a class = 'btn btn-primary' id = '4'>4</a>
<a class = 'btn btn-primary' id = '5'>5</a>
<a class = 'btn btn-primary' id = '6'>6</a>
<a class = 'btn btn-primary' id = '+'>+</a>
<br/>
<a class = 'btn btn-primary' id = '1'>1</a>
<a class = 'btn btn-primary' id = '2'>2</a>
<a class = 'btn btn-primary' id = '3'>3</a>
<a class = 'btn btn-primary' id = '.'>.</a>
<br/>
<a class = 'btn btn-primary bigButton' id = '0'>0</a>
<a class = 'btn btn-primary bigButton' id = 'total'>=</a>
</div>
<link rel = 'stylesheet' type = 'text/javascript' href = 'calc.js'>
</body>

Gersho
@Gersho
Jan 03 2018 01:11
use ``` to format code (before and after your code)
Cade
@CStombaugh
Jan 03 2018 01:12
@Gersho thanks for the tip, I'll try that next time
CamperBot
@camperbot
Jan 03 2018 01:12
cstombaugh sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 551 | @gersho |http://www.freecodecamp.org/gersho
Alfonso Lamadrid
@almdrx
Jan 03 2018 01:24
@CStombaugh alright, have you opened the browser devtools' network panel to see if the script file is found?
I just loaded the html here (with a fake calc.js file) and it seems to be working fine :) perhaps is a 404 error
do you have the javascript file in the same directory as the html file?
Cade
@CStombaugh
Jan 03 2018 01:27
yep @alfonsolmdrx, it's all in the same file. i'll look around a little more in the devtools to see if I can narrow something down. I don't have a ton of experience using the devtools yet but it did help me catch an error yesterday
I just refreshed while on the network tab and the JS file showed up
Alfonso Lamadrid
@almdrx
Jan 03 2018 01:28
:fire:
:smile:
what happens when you open it in a new tab without the devtools?
Cade
@CStombaugh
Jan 03 2018 01:30
still doesn't function
nothing happens when I click on any buttons
Alfonso Lamadrid
@almdrx
Jan 03 2018 01:31
@CStombaugh alright no worries... this is the best part, let's figure it out
Let's debug this over PM alright?
Ruben Abraham
@BuBBRBbr1
Jan 03 2018 02:08
Hey everyone. I am stuck on putting placeholder images in the areas of my portfolio page. How do I do this? Because I am new to FCC or have not done twitch jpi apps yet, I need help on Codepen to put placeholder images in their place. Can anyone help me?https://codepen.io/BuBBRBbr1/pen/eyvbmP
iso
@iso1048
Jan 03 2018 02:57
@CStombaugh did you try putting the script tags right before the closing body tag? (I do not work locally so I'm not sure if that would fix your issue)
Cade
@CStombaugh
Jan 03 2018 02:59
Thanks @gothamknight , I worked with @alfonsolmdrx on it and that was basically the fix. I appreciate you giving some input on it
CamperBot
@camperbot
Jan 03 2018 02:59
cstombaugh sends brownie points to @gothamknight and @alfonsolmdrx :sparkles: :thumbsup: :sparkles:
:cookie: 4 | @alfonsolmdrx |http://www.freecodecamp.org/alfonsolmdrx
:cookie: 476 | @gothamknight |http://www.freecodecamp.org/gothamknight
Marcus Parsons
@marcusparsons
Jan 03 2018 02:59
@BuBBRBbr1, I use https://picsum.photos/ to get placeholders to put on a site. You can specify sizes and other criteria I believe.
shivam gupta
@shivamg11000
Jan 03 2018 03:08
what's the default size of px of root element in mac
Eric Weiss
@eweiss17
Jan 03 2018 03:38
looking on advise for my about section
Botenga
@Botenga
Jan 03 2018 03:49
Hello my fellow campers. Can anybody help me with a issue I am having?
https://codepen.io/Botenga/pen/VybPLE
My issue is that the forest image is in a thumbnail but the height is out of control . It should be similar to the other tumbnails.
I have tried giving it a class and using css to change the height but it doesn't apply.
any help would be appreciated
iso
@iso1048
Jan 03 2018 03:59
@Botenga what do you think about using this instead of what you currently have?
.thumbnail{
  max-height:280px;
  overflow: hidden;
  width:auto;
}
Botenga
@Botenga
Jan 03 2018 04:09
@gothamknight The issue with that is that it doesnt fill the full width of the photo.
Botenga
@Botenga
Jan 03 2018 04:15
I guess i better pick a smaller photo
iso
@iso1048
Jan 03 2018 04:15

@Botenga

.thumbnail {
  height:400px;
  overflow:hidden;
  width:auto;
}
img {
  width: 100%;
}

?

that shows the full width but crops the height
Botenga
@Botenga
Jan 03 2018 04:15
let me give it a try @gothamknight lolz
nope now its messing with different photos
I mean the other photo
photos
thanks anyway mate @gothamknight
CamperBot
@camperbot
Jan 03 2018 04:18
botenga sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 477 | @gothamknight |http://www.freecodecamp.org/gothamknight
aRtoo
@artoodeeto
Jan 03 2018 05:18
background-image: url("https://pixabay.com/photo-2560981/"); is there something wrong with this?
not showing up
nvm fam i got it
kerafyrm02
@kerafyrm02
Jan 03 2018 05:52
anyone need help?
Tarun Khandelwal
@Delwalt
Jan 03 2018 07:12
Yes

$(function() {
String.prototype.decodeHTML = function() {
return $('<div>', {html: '' + this}).html();
};

var $main = $('main'),

init = function() {
 alert('Hi I am running');
},

ajaxLoad = function(html) {
  document.title = html
    .match(/<title>(.*?)<\/title>/)[1]
    .trim()
    .decodeHTML();

  init();
},

loadPage = function(href) {
  $main.load(href + ' main>*', ajaxLoad);
};

init();

$(window).on('popstate', function(e) {
if (e.originalEvent.state !== null) {
loadPage(location.href);
}
});

$(document).on('click', 'a, area', function() {
var href = $(this).attr('href');

if (href.indexOf(document.domain) > -1
  || href.indexOf(':') === -1)
{
  history.pushState({}, '', href);
  loadPage(href);
  return false;
}

});
});

I have this code for history.pushState
When I click on a link the ajax loads the new page without any problem but the issue is when I hit back button the url changes but the old page does not show up.
Kartik Mudgal
@Sprinting
Jan 03 2018 10:05
thanks
elad ben aderet
@eladonline
Jan 03 2018 11:32
@Sprinting sry but this game is full of bugs
like, the light are playing together
or onHover the line under sprinting is jumping
Kartik Mudgal
@Sprinting
Jan 03 2018 11:33
the lights are playing together? I thought i fixed that :cry:
elad ben aderet
@eladonline
Jan 03 2018 11:33
@Sprinting i found a lot more try again my friend im sure youl make better the secon time
Kartik Mudgal
@Sprinting
Jan 03 2018 11:33
the line jumping is not a bug tho
@eladonline could you list?
elad ben aderet
@eladonline
Jan 03 2018 11:33
@Sprinting this is no normal behavior
Kartik Mudgal
@Sprinting
Jan 03 2018 11:34
The line is jumping because the the link's margin changes on hover. that's not a problem . I made it do so
elad ben aderet
@eladonline
Jan 03 2018 11:35
@Sprinting so change that this is not something to do on purpose
Kartik Mudgal
@Sprinting
Jan 03 2018 11:36
eh, I think It looks nice. I'm really bugged about about those lights playing together. timer's in js are irritating to work with
elad ben aderet
@eladonline
Jan 03 2018 11:36
@Sprinting take this as an example https://codepen.io/eladonline/pen/KWLVJo
Kartik Mudgal
@Sprinting
Jan 03 2018 11:36
maybe i should just scrap the timing function and write it again
elad ben aderet
@eladonline
Jan 03 2018 11:37
@Sprinting whatever you find to be a good solution
Sorin Ruse
@sorinr
Jan 03 2018 11:47
@eladonline your design has also css bugs. i can't see even on desktop the full page. your <canvas id="myCanvas" width="750" height="750"> is only partly visible on a laptop 15.6" display. i don't even tried to see the pen on mobile
Xapuu
@Xapuu
Jan 03 2018 11:50
Hey guys can someone take a look at this https://codepen.io/xapu/pen/ZvJOme , i want to make the div with make-me-wide class to take 100% of the screen, overlaying the sidebar, thanks in advance :)
Sorin Ruse
@sorinr
Jan 03 2018 11:56
@Xapuu your <div class="make-me-wide"></div> has a 100% width but from his parent <div class="some-outlet"> that has a 90% width of its parent :)
Xapuu
@Xapuu
Jan 03 2018 11:58
@sorinr I know that, actualy im working on an angular projet and make me wide is a child component, so i cant change the parrent, because that will break other stuff :D
Sorin Ruse
@sorinr
Jan 03 2018 11:59
@Xapuu then your css class must be something like:
.make-me-wide{
    display: flex;
  position: absolute;
  left: 0;
    height: 20px;
    width: 100%;
    background: red;
}
@Xapuu if this is what u want to achieve
Xapuu
@Xapuu
Jan 03 2018 12:05
@sorinr thanks it works in the pen, time to try it in the app :D
CamperBot
@camperbot
Jan 03 2018 12:05
xapuu sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1385 | @sorinr |http://www.freecodecamp.org/sorinr
Sorin Ruse
@sorinr
Jan 03 2018 12:05
@Xapuu :+1:
mustimuu
@mustimuu
Jan 03 2018 12:06
Hello guys
I have got a question.

What does this mean? its releated to wordpress:

Enable HTTP compression and add headers to reduce server load and decrease file load time.

Sorin Ruse
@sorinr
Jan 03 2018 12:07
well, ask if we can help we help :)
mustimuu
@mustimuu
Jan 03 2018 12:08
@sorinr i asked
:D
Sorin Ruse
@sorinr
Jan 03 2018 12:10
@mustimuu sorry, wordpress its not the thing i like but maybe reading this may help you solve the problem :)
mustimuu
@mustimuu
Jan 03 2018 12:11
Thank you
Sorin Ruse
@sorinr
Jan 03 2018 12:12
welcome
primuscovenant
@primuscovenant
Jan 03 2018 13:17
@heroiczero thx
CamperBot
@camperbot
Jan 03 2018 13:17
primuscovenant sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 2125 | @heroiczero |http://www.freecodecamp.org/heroiczero
Puyan Wei
@puyanwei
Jan 03 2018 13:21
Hi guys, I'm trying to understand preventDefault() better. But I don't understand why in this code clicking the tiger link it will create the InnerHTML "tiger", then suddenly reset the page (is that what its doing?)
<body>
  <a href="" id="tiger-link">Tiger</a>
  <div id="animal"></div>

  <script>
    makeTigerLinkClickSayTiger();

    function makeTigerLinkClickSayTiger() {
      document
        .getElementById("tiger-link")
        .addEventListener("click", function(clickEvent) {
          sayTiger();
        });
    }

    function sayTiger() {
      document.getElementById("animal").innerHTML = "tiger";
    }
  </script>
</body>
Tiago Correia
@tiagocorreiaalmeida
Jan 03 2018 13:59
the refresh is realted to the href=""
and you could have made this code a little more small avoiding having to create a function and call it :D
<body>
  <a id="tiger-link">Tiger</a>
  <div id="animal"></div>

  <script>
      document
        .getElementById("tiger-link")
        .addEventListener("click", function(clickEvent) {
          sayTiger();
        });

    function sayTiger() {
      document.getElementById("animal").innerHTML = "tiger";
    }
  </script>
</body
this would work
Daniel Romero
@Ranacode
Jan 03 2018 14:40
Hey guys
I'm trying do a chatbox layout with flexbox but I discover today that I sucks on CSS
I want to have a left sidebar, main box for messages and the input + button below this to send messages
but I cannot reach a good layout for this
anyone have good idea to improve this shit? xD
glandon22
@glandon22
Jan 03 2018 14:43
what is going to be in your sidebar on the left
?
Daniel Romero
@Ranacode
Jan 03 2018 14:43
The people names and avatar
glandon22
@glandon22
Jan 03 2018 14:44
id probably make the siebar 100% height of the screen
Daniel Romero
@Ranacode
Jan 03 2018 14:44
but for now I just want the skeleton
glandon22
@glandon22
Jan 03 2018 14:44
and move the search bar up higher
Marc
@MWBauer
Jan 03 2018 16:08
Morning everyone!
:coffee: :wave:
Marc
@MWBauer
Jan 03 2018 16:24
Anyone here?
Matej Bošnjak
@mbosnjak01
Jan 03 2018 16:25
sometimes
glandon22
@glandon22
Jan 03 2018 16:25
hanging around
Marc
@MWBauer
Jan 03 2018 16:25
lol
I'm trying to get the fa-search icon inside my text field for the wiki viewer.
Do I just need to make it a button outside of the box?
Matej Bošnjak
@mbosnjak01
Jan 03 2018 16:26
like, inside placeholder?
Marc
@MWBauer
Jan 03 2018 16:26
yes
 <div>
   <input <i class="fa fa-search"></i> type="text">
   <b>
     Type in field to search for a specific Wiki Topic</b>
sorry I forgot the </div>
Matej Bošnjak
@mbosnjak01
Jan 03 2018 16:27
you can't add it like that
lel
you'll need to do it via css
Marc
@MWBauer
Jan 03 2018 16:27
ok
thx
Just found this :)
Marc
@MWBauer
Jan 03 2018 16:34
<div class="container fluid">
   <div class="color">
      The Wiki Viewer
   </div>
   <div>
      <button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i>Click me for a random Wiki Topic</button>
      <br>
   </div>
   <div>
       <input type="text">
         <i class="i fa fa-search">
        <br>
        <b class="b">Type in field to search for a specific Wiki Topic</b>
</div>
</div>
Why am I getting multiple fa-search at the bottom of my page?
glandon22
@glandon22
Jan 03 2018 16:35
do you have a codepen for this you can share?
it looks like you have two buttons
not sure how many you are wanting lol
Marc
@MWBauer
Jan 03 2018 16:38
  1. But at the bottom after the specific search field it has 2 more search icons
2
James Moore
@James-N-M
Jan 03 2018 16:40

`const container = document.querySelector("#container");

    const content = document.createElement('div'); 
    content.classList.add('content'); 
    content.textContent = 'This is the glorious text-content!'; 

    container.appendChild(content); 

    const paragraphToAdd = document.createElement('p'); 
    paragraphToAdd.style.color = 'red'; 
    paragraphToAdd.textContent = 'Hey I\'m red! '; 

    container.appendChild(paragraphToAdd); 

    const headerThreeToAdd = document.createElement('h3'); 
    headerThreeToAdd.style.color = 'blue'; 
    headerThreeToAdd.textContent = "I\'m a blue h3 ! "; 

    container.appendChild(headerThreeToAdd); 

    /* child div to add to the container */ 

    const divToAdd = document.createElement('div'); 
    divToAdd.classList.add('moreContent'); 
    divToAdd.style.cssText = 'border: solid black; background: pink';

    const headerOneToAddToDiv = document.createElement('h1'); 
    headerOneToAdd.textContent = 'I\'m in a div';

    const paragraphToAddToDiv = document.createElement('p'); 
    paragraphToAdd.textContent = 'ME TOO! ';

    divToAdd.appendChild(headerOneToAddToDiv);
    divToAdd.appendChild(paragraphToAddToDiv);

    container.appendChild(divToAdd); 

`

trying to add another div to the container
this div has children
seems to work up to the trying to add the div with the children
Marc
@MWBauer
Jan 03 2018 16:42
Sorry guys. Gotta' run to the doctor then work.
glandon22
@glandon22
Jan 03 2018 16:42
@MWBauer one of your <i> tags is missing a close
Marc
@MWBauer
Jan 03 2018 16:42
Have a great day
thanks.
glandon22
@glandon22
Jan 03 2018 16:43
that should fix your problem
Marc
@MWBauer
Jan 03 2018 16:43
Sho did
in a heartbeat.
thanks.
glandon22
@glandon22
Jan 03 2018 16:43
great
no problem
Marc
@MWBauer
Jan 03 2018 16:46
can someone break down what this means? ```
::-moz-placeholder::before  { font-family: fontAwesome; content:'\f002  '; color: #69f }
glandon22
@glandon22
Jan 03 2018 16:47
@James-N-M i think you may need to append the divs to the DOM in the opposite order
looks like its for placeholder text
but its outdated now
Shahe Imran
@bddarknight
Jan 03 2018 17:32
I can't access to my freecodecamp account authorised by my github account
Emerson Lopes
@lupuselit
Jan 03 2018 17:33
What goes wrong?
Shahe Imran
@bddarknight
Jan 03 2018 17:37
getting this message. I even tried cleaning up my browser cookies and everything. it did not help either.
Emerson Lopes
@lupuselit
Jan 03 2018 17:41
that's odd, havent you changed your email on github? and make sure to be trying to login at https://www.freecodecamp.org/signin
if it doesn't work you should try to create a new account
Shahe Imran
@bddarknight
Jan 03 2018 17:52
Oh No! I will lose my track with new account.
James Moore
@James-N-M
Jan 03 2018 18:38
@glandon22 Thanks i had mis spelled some variable names
CamperBot
@camperbot
Jan 03 2018 18:38
james-n-m sends brownie points to @glandon22 :sparkles: :thumbsup: :sparkles:
:cookie: 296 | @glandon22 |http://www.freecodecamp.org/glandon22
Chris
@bestintown23
Jan 03 2018 18:49
why are my social media icons showing on a slant? https://codepen.io/bestintown23/pen/gogmVB
James Moore
@James-N-M
Jan 03 2018 18:50
@bestintown23 The images are probably different sizes/ are not actually in a like div or something
some kind of container where the paddings and things are all the same @bestintown23
right click and view the properties of the images and see if there all the same
glandon22
@glandon22
Jan 03 2018 18:55
@bestintown23 you should try giving the containers the social media icons are in a set size then position the images within them
Ken Haduch
@khaduch
Jan 03 2018 18:58
@catherinewoodward - I was able to see your profile at this link: https://www.freecodecamp.org/catherinewoodward - so it looks like you still have data out there.
glandon22
@glandon22
Jan 03 2018 19:05
@bestintown23 was messing around with your pen a little. https://codepen.io/glandon22/pen/NXvXrr?editors=1100
were you looking to do something more like that? you can mess around with it more
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:05
could use help really quicik
why wont the pictures in this code pen change based off of the variable cel's data??? I have been stuck for a while on this
glandon22
@glandon22
Jan 03 2018 19:06
whats up man
glandon22
@glandon22
Jan 03 2018 19:06
someone can probably help out]
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:08
would i need to mess with the css styling?
glandon22
@glandon22
Jan 03 2018 19:09
what do you mean?
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:10
so I want the background picture to change based on the temperature
I am attempting to do that with an if statment
glandon22
@glandon22
Jan 03 2018 19:11
if youre using jQuery with your project you can use that to set the background
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:11
how!
that is exactly what i need
I am trying to do it in an if statment
glandon22
@glandon22
Jan 03 2018 19:12
let me look at my project because i did the same thing, and i will show some code
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:12
Thank you @glandon22
CamperBot
@camperbot
Jan 03 2018 19:12
html-joe sends brownie points to @glandon22 :sparkles: :thumbsup: :sparkles:
:cookie: 297 | @glandon22 |http://www.freecodecamp.org/glandon22
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:12
@GitHub-Henry
Henry
@GitHub-Henry
Jan 03 2018 19:12
image.png
I noticed there were a few things about your code
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:13
AHAHAHAHAHA yeah that would do it
Henry
@GitHub-Henry
Jan 03 2018 19:13
didn't know if you were aware of the Analyze function
glandon22
@glandon22
Jan 03 2018 19:13
lol
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:13
I was aware I just thought I had saved
glandon22
@glandon22
Jan 03 2018 19:13
i used plain javascript: document.body.style.backgroundImage = "url('cloudy.jpg')";
where what was inside the quotes in url is a link to the image
does that make sense?
Gersho
@Gersho
Jan 03 2018 19:14
the way you put your { after your if makes my eyes bleed
Kris Baillargeon
@krisb1220
Jan 03 2018 19:14
no @glandon22
you're assigning the string you provided to an object property not an HTML element
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:15
thank you @Gersho
CamperBot
@camperbot
Jan 03 2018 19:15
html-joe sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 552 | @gersho |http://www.freecodecamp.org/gersho
Kris Baillargeon
@krisb1220
Jan 03 2018 19:15
I could be wrong cause I don't know the rest of your code, but try assigning it to /....backgroundImage.src = "cloudy.jpg"
Gersho
@Gersho
Jan 03 2018 19:16
i don't remember being any help ~.~
glandon22
@glandon22
Jan 03 2018 19:16
@krisb1220 its been a really long time since i mage the weather app but thats from my script and its working fine on heroku. i have the images saved locally with the rest of the files so that may be why
honestly cant remember that well lol
Kris Baillargeon
@krisb1220
Jan 03 2018 19:17
I'm not sure then :P
glandon22
@glandon22
Jan 03 2018 19:18
i think it looks odd if youre used to jQuery
Kris Baillargeon
@krisb1220
Jan 03 2018 19:21
Well that's a lot of people's problem
They avoid OOP because they don't use JS for anything besides jQuery and manipulating the DOM
Not anyone specifically and not you :P
But I see a lot of people who rely so heavily on jQuery that when they have to move onto stuff like JSON they have to completely relearn OOP
(like me)
glandon22
@glandon22
Jan 03 2018 19:24
lol
its definitely worthwhile to learn some vanilla JS
there r so many libraries and framworks for js tho
its wild
Kris Baillargeon
@krisb1220
Jan 03 2018 19:24
Well not for nothing, if I could find a great idea for a framework I would definitely make it :laughing:
Kudzu
@czhower
Jan 03 2018 19:25
Or the types that believe OOP is "dead" and that they can do everything in FP....
Kris Baillargeon
@krisb1220
Jan 03 2018 19:25
Yeah if you want your code to look like algebra
and if you want to create debugging hell
Kudzu
@czhower
Jan 03 2018 19:27
exactly. FP is great - when it fits.. but it doesnt fit everywhere.
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:35
how do you know which line of code the analyze is referring to?
glandon22
@glandon22
Jan 03 2018 19:38
looks like all the red error messages stack up under the line where the error happens
so that first group of three is related to the code on line49
so where would the first error be here?
still 49?
glandon22
@glandon22
Jan 03 2018 19:41
i was looking at this codepen you posted before: https://codepen.io/JoeSanJr/pen/NXbKYb?editors=1010
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:43
yes sorry I meant to link that
I am still a bit confused ahahaha I have created a debugging nightmare here
for me at least
glandon22
@glandon22
Jan 03 2018 19:44
hahaha
its a little tangled
but fixable
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:45
Okay so the first error that says label https and the second one that says label identifier
which lines are those referring to
I just cant figure out how the errors stack so knowing the first two will clear up my brain fart
glandon22
@glandon22
Jan 03 2018 19:46
repost your codepen
i think im looking at an old version i edited or something
glandon22
@glandon22
Jan 03 2018 19:48
the error is related to the line directly above it
like im looking at one of line 58
where you have this: else {conversion===false
and it says "unexpected token else"
the problem here is that else statements cant have a comparison, only an "if" or "else if"
so you cant update that to else if (conversion === false) {
does that make sense?
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:51
makes sense still a ton of errors after doing that though
glandon22
@glandon22
Jan 03 2018 19:51
hahaha ya
i know the feeling
debugging sucks
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:53
hahahaha WHERE IS THE MISSING SEMI COLON
I am just gonna go line by line and put one there
I give in
glandon22
@glandon22
Jan 03 2018 19:53
no no
you have wayyyy too many semicolons as is lol
Joseph A. Sangine
@HTML-joe
Jan 03 2018 19:54
semi colon you win sir
okay i give in
where am i going wrong here anyone care to be kind enough to explain?
forgive me for the questions i have just been stuck for days
Stephen James
@sjames1958gm
Jan 03 2018 20:02
@HTML-joe
if (conversion===true); << this semicolon breaks the if
else if (conversion===false ); << then this one
Henry
@GitHub-Henry
Jan 03 2018 20:03
@HTML-joe eventually you'll want a job, & at that job you'll be required to do things their way, until then, how about coding per some set of standards. for now, consider coding things the way w3schools does, until you find a better way. https://www.w3schools.com/js/js_if_else.asp. It would be good to make your code look vaguely like most other coders, not the Joe standard of coding. that is until you get to be as big as gates or zuckerberg then you can do things your own way.
Joseph A. Sangine
@HTML-joe
Jan 03 2018 20:04
do you just mean the way i write it @GitHub-Henry
Henry
@GitHub-Henry
Jan 03 2018 20:05
yes, look at the w3schools way of coding an if, and perhaps make your if statements similar
it will actually help your code and others when they look at it
Kris Baillargeon
@krisb1220
Jan 03 2018 20:05
Just keep your code semantic
Joseph A. Sangine
@HTML-joe
Jan 03 2018 20:06
I will try to attune to that statndard then, thank you for the advice
Henry
@GitHub-Henry
Jan 03 2018 20:06
hope it helps
Gersho
@Gersho
Jan 03 2018 20:07
it'll help you reading others code too if you are more used to that method of writing
Daniel Romero
@Ranacode
Jan 03 2018 20:32
Hi guys
How can I achieve that my sidebar take the full width of the browser?
I mean, all the background color you can see down
I tried with vh unit but it doesn't work
Stephen James
@sjames1958gm
Jan 03 2018 20:36
@Ranacode You tried
height: 100vh;
for the .Chat class?
Daniel Romero
@Ranacode
Jan 03 2018 20:40
It works, thaks @sjames1958gm
Stephen James
@sjames1958gm
Jan 03 2018 20:40
@Ranacode I don't know if that is the ideal way to do that, but I have used it in the past
Daniel Romero
@Ranacode
Jan 03 2018 20:41
Yes, with vh unit I can avoid the dependency of a parent height
Jacob Pieczynski
@JacobPie
Jan 03 2018 21:09
How can you make your background an image in codepen?
Tiago Correia
@tiagocorreiaalmeida
Jan 03 2018 21:13
background-image: url("www.something.com");
Jacob Pieczynski
@JacobPie
Jan 03 2018 21:16
@tiagocorreiaalmeida Thanks
CamperBot
@camperbot
Jan 03 2018 21:16
jacobpie sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 485 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Jacob Pieczynski
@JacobPie
Jan 03 2018 21:58
Quick question: How could I configure the jquery so that when I click 'enter site', the .visible class disappears and the .invisible class reappears? I already figured out how to make the .visible class disappear... https://codepen.io/JakePie/pen/aEyYqw
Tiago Correia
@tiagocorreiaalmeida
Jan 03 2018 22:48
@JacobPie got a bit confused
what are you trying to do?
Jacob Pieczynski
@JacobPie
Jan 03 2018 22:49
@tiagocorreiaalmeida Figured it out. Thanks anyways
CamperBot
@camperbot
Jan 03 2018 22:49
jacobpie sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 486 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Stephen James
@sjames1958gm
Jan 03 2018 23:18
@JacobPie BTW, you can string the addClass / removeClass
$('#two').removeClass('invisible').addClass("visible");
Bakhtiiar Muzakparov
@muzakparov
Jan 03 2018 23:29
Hello everyone
any good resource for freezing both the first column and table header guys? i find sources either one of them was frozen(fixed), but not both.
While programming the Pomodoro app I coded a timer from scratch. I said ey it would be great to create a framework that help people do the same with less of code. so I created it and you can use it in both server and client side. Please test and give feedback: https://www.npmjs.com/package/@gilbert2017/simple-timer
Keegan
@Keggatron
Jan 03 2018 23:39

Hey guys, I'm having an issue with a 429 error calling for too many requests that I am completely unsure how to solve. I'm getting the error when trying to make an axios api call to my Express server from my React frontend app.
Here is the backend route:

app.get('/api/fetchproducts', async (req, res) => {
    const products = await Product.find({});
    res.send(products);
  });

And here is the axios call from the frontend:

import axios from 'axios';
import { FETCH_PRODUCTS } from "./types";

export const fetchProducts = () => async dispatch => {
  const res = await axios.get('/api/fetchproducts');

  dispatch({ type: FETCH_PRODUCTS, payload: res.data });
};

Can anyone help me with this issue?
_

Bjorn van de Peut
@bjorno43
Jan 03 2018 23:40
If someone is willing and able to help, they will reply. Just be patient ;)