These are chat archives for FreeCodeCamp/HelpFrontEnd

16th
Nov 2017
Chris
@bestintown23
Nov 16 2017 00:10
help, i am trying to add a section to my page to display my prices for work, problem is if you look at the page, where is says"the cost" is way off to the right of the page but i need it to be on the left. https://codepen.io/bestintown23/pen/bYoqrO
Daniel
@DanJP2016
Nov 16 2017 00:31
@bestintown23 i don't understand what the container class you have in your html is for. where you meaning to use bootstrap for this? is so you need to add the library under settings css, and that fixes the alignment issue. i forked your pen and you should be able to see my changes here
https://codepen.io/bones211/pen/zPEZLo?editors=1000
A-J Roos
@Asjas
Nov 16 2017 00:33
@DanJP2016 Please be aware he posted this in 3 different channels. Someone is helping him in codereview if you want to help him in that channel
Daniel
@DanJP2016
Nov 16 2017 00:33
@Asjas ah, did not know that lol
A-J Roos
@Asjas
Nov 16 2017 00:34
Yup :)
BladymirL
@BladymirL
Nov 16 2017 01:12
Hello! I am working on my tribute page here, I (very obviously) used the one they made originally as a template essentially. Would you guys say this is an okay attempt? Should I try to add any other features to it before advancing to the next one?
It doesn't seem to scale too well if it's a smaller resolution which is the only thing I can think of trying to fix
Henry
@GitHub-Henry
Nov 16 2017 01:22
@BladymirL it's a good first project. you'll have plenty of time to advance your skills with future projects, next. :+1:
abraham anak agung
@padunk
Nov 16 2017 01:23
@BladymirL your image is out of the gray container and last 2 quotes have margin too big. And you could use some padding in you list
Henry
@GitHub-Henry
Nov 16 2017 01:24
@padunk i thought so also, but when I put the project on full, and used 100% it wasn't the case
abraham anak agung
@padunk
Nov 16 2017 01:25
@GitHub-Henry nope, my fullscreen show the same. or my screen isn't wide enough :smile:
Henry
@GitHub-Henry
Nov 16 2017 01:27
@padunk this is what i see
image.png
abraham anak agung
@padunk
Nov 16 2017 01:33
Untitled.png
Daniel
@DanJP2016
Nov 16 2017 01:37
looks like he is using bootstrap, but not taking advantage of it. maybe re-write the html to use some containers and such to clean it up some. nice project though, Bruce Lee !!
Henry
@GitHub-Henry
Nov 16 2017 01:38
@padunk perhaps something has changed, now i have the same image at 100%. Loved watching Bruce ages ago.
Daniel
@DanJP2016
Nov 16 2017 01:44
forms are kind of a pain in the ass to style
Quantomistro3178
@Quantomistro3178
Nov 16 2017 01:49

function largestOfFour(arr) {
  // You can do this!
  var sortArr = [];
  var finalArr = [];

  for (var i=0; i < arr.length; i++) {
    sortArr.push(arr[i].sort(function (a,b) {
    return b -a;
  }));}  

  for (var x=0; x<sortArr.length; x++){
    finalArr.push(sortArr[i][0]);
  }

  return sortArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
its giving me a TypeError: Cannot read property '0' of undefined
Henry
@GitHub-Henry
Nov 16 2017 01:49
@BladymirL how about using % instead of px on your bruce class, something like this...
.bruce {
  width: 100%
}
Quantomistro3178
@Quantomistro3178
Nov 16 2017 01:52
nvm
i just made a silly mistake
Sorin Ruse
@sorinr
Nov 16 2017 02:15
@BladymirL you need the class "img-responsive" like: <img class="bruce center-block img-responsive" .......
Harsh Chandra
@HarshHC
Nov 16 2017 02:49
@bankplank yes, im using bootstrap 4, thanks for that code could u pls also tell me hoe can I do it with bootstrap? :smile:
CamperBot
@camperbot
Nov 16 2017 02:49
harshhc sends brownie points to @bankplank :sparkles: :thumbsup: :sparkles:
:cookie: 301 | @bankplank |http://www.freecodecamp.org/bankplank
Harsh Chandra
@HarshHC
Nov 16 2017 02:50
@bankplank bootstrap 4 disk work when I added it from settings in codepen so I added it with its cdn directly in my head element
Tchr. Joe Gachau
@tchrjoegachau
Nov 16 2017 03:07
Now learning Boolean operators. I need to fasten up so that i start building projects asap!
kha97
@kha97
Nov 16 2017 04:01

hey guys i am on the simon game project and for the sequence of backgroundcolors to show up and come back to their original colors i used settimeout but itts not working

case 'red':
     document.getElementById(colorArr[randArr[i]]).style.backgroundColor='#FF4545';
     setTimeout(function (){
         document.getElementById(colorArr[randArr[i]]).style.backgroundColor=colorArr[randArr[i]];    },100);
     break;

and its the same for the rest of three colors what am i doing wrong ?

Kris Baillargeon
@krisb1220
Nov 16 2017 04:15
@kha97 setTimeOut() is deprecated
I have everything except the sequences down for that project LOL
But I think I have a solution
It involves a while loop, if I were you I would figure the rest out but I'm more than willing to tell you because its simple
kha97
@kha97
Nov 16 2017 04:18
@krisb1220 setTimeOut() is deprecated ? what do you mean exactly? hhh I get you man i spent the better part of the night staring at it before coming here
Kris Baillargeon
@krisb1220
Nov 16 2017 04:19
I'll just explain lol
Ever Lord
@ev3rlord
Nov 16 2017 04:20
@krisb1220 Umm setTimeout() deprecated?
Kris Baillargeon
@krisb1220
Nov 16 2017 04:20

https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Code_snippets/Timers

On this page it lists setTimeOut() as a "Javascript" timer

Javascript timers are deprecated
Wait
Did I misread that first sentence? lol
What I took from that page is that the listed functions are deprecated, but now that I'm looking at it, it words it as "add-ons". Not sure what that means actually, but every time I've tried to use setTimeOut() it returns not a function
Ken Haduch
@khaduch
Nov 16 2017 04:22
@kha97 - you should still be able to make it work, what's happening when you run your code?
Ever Lord
@ev3rlord
Nov 16 2017 04:23
@krisb1220 it's setTimeout()
lowercase o
kha97
@kha97
Nov 16 2017 04:24
@khaduch the first line works by that i mean the background-color changes
but the function inside the settimeout doesnt work by that i mean i waited the 1000 ms and the color still doesnt change
Kris Baillargeon
@krisb1220
Nov 16 2017 04:24
I'm going to kill myself lol
Ever Lord
@ev3rlord
Nov 16 2017 04:24
:D
Kris Baillargeon
@krisb1220
Nov 16 2017 04:25
I actually kind of hate you rn
But much love
<3
thanks @ev3rlord
CamperBot
@camperbot
Nov 16 2017 04:25
krisb1220 sends brownie points to @ev3rlord :sparkles: :thumbsup: :sparkles:
:cookie: 11 | @ev3rlord |http://www.freecodecamp.org/ev3rlord
kha97
@kha97
Nov 16 2017 04:25
@ev3rlord thx btw i am going to jump off a bridge now
CamperBot
@camperbot
Nov 16 2017 04:25
kha97 sends brownie points to @ev3rlord :sparkles: :thumbsup: :sparkles:
:cookie: 12 | @ev3rlord |http://www.freecodecamp.org/ev3rlord
kha97
@kha97
Nov 16 2017 04:26
@krisb1220 thx you 2 and good luck on your project
Kris Baillargeon
@krisb1220
Nov 16 2017 04:26
I'm going to open a pop-up webshop that sells funny "i'm going to kill myself" sayings on tshirts & market them to developers
anyone tryna go 50 / 50 ?
Lol np @kha97
Ken Haduch
@khaduch
Nov 16 2017 04:27
@kha97 - the code that you pasted only shows 100 for the count, but what value to do you get when you use colorArr[randArr[i]];? It might possibly be a problem with the value of i changing if you are running this in a loop of some kind, such that when the timeout time completes, i is no longer the same value as when you set the timeout.
kha97
@kha97
Nov 16 2017 04:29
@khaduch it was a spelling mistake setTimeOut instead of setTimeout
@krisb1220 its probably already been done
Kris Baillargeon
@krisb1220
Nov 16 2017 04:36
SEE HE DID IT TOO
gang gang
Dr-D-M
@Dr-D-M
Nov 16 2017 04:38
hey there
Look, I've been asking this here for a couple days, and i wouldn't like to bother but
I just don't understand the wikipedia api
Kris Baillargeon
@krisb1220
Nov 16 2017 04:39
I probably won't either, but what about it?
Dr-D-M
@Dr-D-M
Nov 16 2017 04:39
damn, is so confusing.... how do I get the url I need to do the search for the project wikipedia viewer
Kris Baillargeon
@krisb1220
Nov 16 2017 04:40
I'll google some stuff for ya real quick lol
Dr-D-M
@Dr-D-M
Nov 16 2017 04:40
I google already
lol
googled*
heroiczero
@heroiczero
Nov 16 2017 04:41
@Dr-D-M you could use https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&titles=Main%20Page&prop=revisions&rvprop=content&format=jsonfm this to create a api link with your specifications. You probably want a search query.
Dr-D-M
@Dr-D-M
Nov 16 2017 04:41
the main question is: how did you generate the right url to make it work and get your page work?
Kris Baillargeon
@krisb1220
Nov 16 2017 04:41
These?

Hint #1: Here's a URL you can use to get a random Wikipedia article: https://en.wikipedia.org/wiki/Special:Random.

Hint #2: Here's an entry on using Wikipedia's API: https://www.mediawiki.org/wiki/API:Main_page.

Dr-D-M
@Dr-D-M
Nov 16 2017 04:41
yeah @heroiczero but, how did you get it?
@krisb1220 yeah, those ones, but, I read that like 10 times already
Kris Baillargeon
@krisb1220
Nov 16 2017 04:42
Well that narrows down what im looking for at least
Wait
Dr-D-M
@Dr-D-M
Nov 16 2017 04:43
@krisb1220 I'll wait man
Kris Baillargeon
@krisb1220
Nov 16 2017 04:43
Are you asking how to take the term the user inputs and append it to the string?
URL string*
Dr-D-M
@Dr-D-M
Nov 16 2017 04:43
that's right
Kris Baillargeon
@krisb1220
Nov 16 2017 04:43
Omg lol
var string = "https://en.wikipedia.org/wiki/" + searchQuery;
Filter spaces
Dr-D-M
@Dr-D-M
Nov 16 2017 04:44
just like that?
so if I do that the user will be able to search and find anything on the page I make?
Kris Baillargeon
@krisb1220
Nov 16 2017 04:45
I havent looked at the challenge myself, nor the API
heroiczero
@heroiczero
Nov 16 2017 04:45
@Dr-D-M you fool around with the sandbox i gave you it generates links. go to "action=query" go to the list and find search in the pull down menu. Then, you probably want to make it a jsonp too
Kris Baillargeon
@krisb1220
Nov 16 2017 04:46
Okay yeah thats^ what I was afraid of lol
It's not as simple as I was thinking it would be
I give bad advice <3
heroiczero
@heroiczero
Nov 16 2017 04:46
it happens. its the thought that matters :)
Dr-D-M
@Dr-D-M
Nov 16 2017 04:47
@krisb1220 don't worry man, jaja you did your best
anyway, when you get to that challenge you'll know what to do
Kris Baillargeon
@krisb1220
Nov 16 2017 04:48
I skip around, I just didnt crack open the API. I appreciate your words of encouragement though, thanks, much love <3 @Dr-D-M
CamperBot
@camperbot
Nov 16 2017 04:48
krisb1220 sends brownie points to @dr-d-m :sparkles: :thumbsup: :sparkles:
:cookie: 260 | @dr-d-m |http://www.freecodecamp.org/dr-d-m
Dr-D-M
@Dr-D-M
Nov 16 2017 04:48
@heroiczero did that, but what's the link I need to put on code?
heroiczero
@heroiczero
Nov 16 2017 04:48
@Dr-D-M you could do some interesting things with it like get the image and description and stuff depending on your link.
Dr-D-M
@Dr-D-M
Nov 16 2017 04:48
is it the one that appears on "Request url"?
Kris Baillargeon
@krisb1220
Nov 16 2017 04:49
var string = "https://en.wikipedia.org/wiki/Special:ApiSandbox#action=" + searchQuery + "&titles=Main%20Page&prop=revisions&rvprop=content&format=" + searchQuery;
Dr-D-M
@Dr-D-M
Nov 16 2017 04:50
@krisb1220 let me see if that works
heroiczero
@heroiczero
Nov 16 2017 04:52
@Dr-D-M something like "https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&meta=&titles=Main%2520Page&callback=%253F&srsearch="+searchQuery should return a list of the search terminology
Dr-D-M
@Dr-D-M
Nov 16 2017 04:52
@heroiczero i'll see if that works as well
@heroiczero @krisb1220 I'll send some sexy mexican maids for you, just because you helped me
LOL
heroiczero
@heroiczero
Nov 16 2017 04:53
Kris Baillargeon
@krisb1220
Nov 16 2017 04:53
I'm DM you the address LMAO
<3
Dr-D-M
@Dr-D-M
Nov 16 2017 04:53
what's the meaning of DM?
Kris Baillargeon
@krisb1220
Nov 16 2017 04:53
direct-message lol
Dr-D-M
@Dr-D-M
Nov 16 2017 04:53
ah! jajaja
Kris Baillargeon
@krisb1220
Nov 16 2017 04:54
so did you end up getting your project to work?
Dr-D-M
@Dr-D-M
Nov 16 2017 04:57
@krisb1220 nope
lol
I'm getting really frustrated
I feel like going nowhere, like my last marriage...lol
I fool around with thte sandbox, and all and then, what's the next step?
heroiczero
@heroiczero
Nov 16 2017 05:00
@Dr-D-M call it with a $.ajax with a dataType:"jsonp"
@Dr-D-M do you know how to access the search list array?
Kris Baillargeon
@krisb1220
Nov 16 2017 05:13

Btw someone asked a question earlier I've seen a thousand times and I couldnt think of an answer at the time

Where can I host an image where it wont disappear later like on Imgur?

Google Drive.

heroiczero
@heroiczero
Nov 16 2017 05:16
i think github is a better solution
Kris Baillargeon
@krisb1220
Nov 16 2017 05:20
Looked into github's disk quota
I'll accept that, but I still luv me sum Google though
Dr-D-M
@Dr-D-M
Nov 16 2017 05:29
@heroiczero Ah, I see it clearly now!
@heroiczero no, I don't know how to access the search list array....so I do the ajax call back in my code right?
```
 $.ajax({
     type: "jsonp",
     url: urlWiki,
     async: false,
     dataType: "jsonp",
     success: function(data){
       console.log(data);
     },
     error: function(errorMessage){
       alert("Error!");
is it like this? @heroiczero
Jay Vora
@jayvora92
Nov 16 2017 05:42

@jayvora92
is there a way to get scarpe value

<a class="ytp-title-link yt-uix-sessionlink" target="_blank" data-sessionlink="feature=player-title" href="https://www.youtube.com/watch?v=vsiezuNtpQg">When It Fits, It Works Better</a>

i want to scrape "When It Fits, It Works Better"

heroiczero
@heroiczero
Nov 16 2017 05:43

@Dr-D-M

$.ajax({
     url: urlWiki,
     dataType:"jsonp",
     success:function(data){
              console.log(data.query.search);
    }
});

something like this make sure you are closing your ajax. This should return your search result in an array.

@Dr-D-M well Good night and best of luck. I am signing out tonight. Getting late. i redid the search result api link in the sand box and i got "https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&callback=JSON_callback&srsearch="+input
Dr-D-M
@Dr-D-M
Nov 16 2017 06:06
@heroiczero thanks a lotman
CamperBot
@camperbot
Nov 16 2017 06:06
dr-d-m sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 2061 | @heroiczero |http://www.freecodecamp.org/heroiczero
DevD
@devd16689
Nov 16 2017 06:25
I know this is a wrong question in wrong group but i am looking for some help.. Can anyone suggest a room for aws ec2
Sorin Ruse
@sorinr
Nov 16 2017 07:01
@krisb1220 another option for hosting your images is cloudinary. they have also a free plan that can satisfy your needs for small testing projects
Sly Fox
@Gurukorgi
Nov 16 2017 07:17
hey guys please does anyone here know how to make a scrollable layer using bootstraps
Sorin Ruse
@sorinr
Nov 16 2017 07:38
@Gurukorgi what do you mean by "scrollable layer"?
A-J Roos
@Asjas
Nov 16 2017 08:07
@devd16689 There is no room here specifically for ec2
Abdul-Samii Ajala Olalekan
@jalasem
Nov 16 2017 09:27
hi everyone, I need how do I define a prop in Vue to expect any data type, be it string or object
something like Any in typescript
export default {
    props: {
        complaint: Any
    }
}
BuntyBru
@BuntyBru
Nov 16 2017 10:01
Hi
suppose i want the "small_box " class element to be in the middle
overlapping all the other divs
what is the best way to do that
i want the <div class= "small_box"> to overlap
Michiel
@MichielHuijse
Nov 16 2017 10:06
Why doesn't this work?
 var len;
 len = argments.length;
 console.log(len);
BuntyBru
@BuntyBru
Nov 16 2017 10:08
i think len should be equal to argments.length();
check it
i guess it should work
Michiel
@MichielHuijse
Nov 16 2017 10:12
No it does not...
BuntyBru
@BuntyBru
Nov 16 2017 10:14

@MichielHuijse
len = argments.length

your syntax was correct,

what is argments btw?
abraham anak agung
@padunk
Nov 16 2017 10:14
arguments, you miss the u
tptynlr
@tptynlr
Nov 16 2017 10:14
it's arguments.length
Michiel
@MichielHuijse
Nov 16 2017 10:16
@BuntyBru
.small_box
{
    margin-bottom: -50px;
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 100px;
  z-index: 100000;
    }
@padunk thanks...
BuntyBru
@BuntyBru
Nov 16 2017 10:17

@MichielHuijse
well i did it
through this

.center {
position: absolute;
left: 200px;
top: 10%;
text-align: center;
background-color: black;
width: 200px;
font-size: 18px;
color: white;
}

i guess i need some lessons on "CSS positioning"
Michiel
@MichielHuijse
Nov 16 2017 10:18
@BuntyBru Good job
I need some lesson spelling :)
BuntyBru
@BuntyBru
Nov 16 2017 10:19
I have totally made up my mind now that i am not going to watch lectures now
i am just going to do practical learning
i was doing weather app project
and suddenly i was having problems regarding positioning of elements
Michiel
@MichielHuijse
Nov 16 2017 10:21
Yes, for me practical learning helps the best. With practical learning when you do not understand something you have a good reason to learn something. For me it is more motivational.
BuntyBru
@BuntyBru
Nov 16 2017 10:22
yeah
just watching lectures is not going to do it
practical is a must
Ivona
@amaranthaST
Nov 16 2017 11:03

hi :smile:

yesterday I had problem with bootstrapping images, after adding bootstrap 3 in settings I lost my background and I can't change it anymore in css?
https://codepen.io/amaranthaST/pen/OOgqNx

Tiago Correia
@tiagocorreiaalmeida
Nov 16 2017 11:20
@amaranthaST
html{
  background-image: url(http://alphabrainsz.net/wp-content/uploads/2016/11/incredible-elegant-black-and-grey-backgrounds-with-html-page-background-color-and-html-page-print-background-color.jpg);

  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  background-position:center;
  background-repeat: no-repeat;
}
and
body{
background-color:transparent;

}
Alvaro
@minutazos
Nov 16 2017 11:22
Hi, I have a very stupid question. If you put an element in hidden or opacity 0, it will be loaded anyways right? (i know is very stupid and i'm pretty sure that is like this, but who knows....)
Ivona
@amaranthaST
Nov 16 2017 11:26
@tiagocorreiaalmeida thank you very much!!!
CamperBot
@camperbot
Nov 16 2017 11:26
amaranthast sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 443 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Markus Kiili
@Masd925
Nov 16 2017 11:30
@minutazos Both opacity: 0 and visibility: hidden hide the element but the element takes the space it has on the layout. The display: none would not render the element, so it would not take space. https://stackoverflow.com/questions/272360/does-opacity0-have-exactly-the-same-effect-as-visibilityhidden/273076#273076
ADIL KARMOUZI
@mradil16
Nov 16 2017 11:31
Guys . I'am new to javascript . I just made this little app . what do you think ??
https://codepen.io/mradil16/full/QOqQop/
Tiago Correia
@tiagocorreiaalmeida
Nov 16 2017 11:31
still it loads the element imagine its a big image it will still effect the load time
Alvaro
@minutazos
Nov 16 2017 11:32
okay what i wanted is to don't load the images :P
Because I dont know how to merge infinite scroll pkgd js with php :S
Alvaro
@minutazos
Nov 16 2017 11:40
anyone knows how to append divs whose content (title, image url, blabla) are charged by php? I have all the platform coded in php and move to json now is almost unthinkable
Michiel
@MichielHuijse
Nov 16 2017 11:58
Hello, I do not understand what is the difference in the number of arguments: supossedly the first function has two arguments. And the second has two?
addTogether(2, 3) should return 5.
addTogether(2)(3) should return 5.
Stephen James
@sjames1958gm
Nov 16 2017 11:59
@MichielHuijse The second one only calls addTogether with one argument. And expects a function to be returned that is called with one argument (3)
@MichielHuijse
var addTwoFn = addTogether(2);
addTwoFn(3)
Michiel
@MichielHuijse
Nov 16 2017 12:00
So the second function is addTogeter(2)?
@sjames1958gm what is the (3) than?
I understand that arguments are divided by comma's..
So: addTogether(2,3,4,5) has 4 arguments. And addTogether(2(4)(4),4) has 2 arguments?
@sjames1958gm thanks
CamperBot
@camperbot
Nov 16 2017 12:03
michielhuijse sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8691 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Michiel
@MichielHuijse
Nov 16 2017 12:04
I am confused, since I would think this (2)(3) would be two arguments aswell.
Markus Kiili
@Masd925
Nov 16 2017 12:06
@MichielHuijse In JS a function can return a function. Here addTogether(2) returns a function and (3) calls it.
If two valid numbers are passed into addTogether, like addTogether(2, 3), then it just adds them and returns a number.
So addTogether needs to check how many arguments are passed and return either a function or a number (and check for argument validity too).
Stephen James
@sjames1958gm
Nov 16 2017 12:09

@MichielHuijse

function test(x) {
   return function(y) { return x + y; }
}
test(1)(2);

test(1) returns a function that is basically (function(y) { return 1 + y; })(2) calling it with (2)

addTogether(2(4)(4),4) this is not valid syntax. 2(4)(4) is not valid
Michiel
@MichielHuijse
Nov 16 2017 12:11
Ok, so addTogether(2)(3)(4); has 1 one argument, but returns three times a function?
@Masd925 ok, thanks: "@MichielHuijse In JS a function can return a function. Here addTogether(2) returns a function and (3) calls it." clarifying
CamperBot
@camperbot
Nov 16 2017 12:12
michielhuijse sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4574 | @masd925 |http://www.freecodecamp.org/masd925
Markus Kiili
@Masd925
Nov 16 2017 12:14
@MichielHuijse The concept of first-class functions takes some chewing. Basically functions are objects and you can store or pass them around like other values.
Michiel
@MichielHuijse
Nov 16 2017 12:17
Ok, yes I understand. So when you see something like this someFunc(2)(3); most likely this function will have a function in a function.
@sjames1958gm in your example `function(y)' automatically collects the (2 ) argument?
Thanks both!
Michiel
@MichielHuijse
Nov 16 2017 12:22
Is there a specific name for a function like this: someFunc(arg)(arg)?
Markus Kiili
@Masd925
Nov 16 2017 12:24
@MichielHuijse Higher order function.
Means a function that gets a function as an argument and/or returns a function.
Stephen James
@sjames1958gm
Nov 16 2017 12:30
@MichielHuijse They really don't explain this new concept very well.
BuntyBru
@BuntyBru
Nov 16 2017 12:47
how to make icons bigger in size
?
suppose
<i class="fa fa-tint" aria-hidden="true">
this is the icon and i want it a bit big
A-J Roos
@Asjas
Nov 16 2017 12:49
@BuntyBru You use another class fa-5 or fa-3
To specify fa size
Ken Haduch
@khaduch
Nov 16 2017 12:49
@BuntyBru - there are additional classes like fa-2x to increase the size
A-J Roos
@Asjas
Nov 16 2017 12:50
Your class would be then <i class="fa fa-tint fa-3" aria-hidden="true">
Ken Haduch
@khaduch
Nov 16 2017 12:50
Did they take away the “x” from those classes?
A-J Roos
@Asjas
Nov 16 2017 12:51
Dunno. I'm on http://fontawesome.io/icon/tint/ and I used chrome inspector to see what classes they are applying to their icons. Seems they only specify the number
BuntyBru
@BuntyBru
Nov 16 2017 12:52
x is needed
<i class="fa fa-tint fa-3x" aria-hidden="true">
works fine
@Asjas @khaduch
Ken Haduch
@khaduch
Nov 16 2017 12:55
Maybe a newer version will support both classes? Anyway, good that it works...
A-J Roos
@Asjas
Nov 16 2017 12:55
Yeah the font awesome site must run another version
Ken Haduch
@khaduch
Nov 16 2017 13:00
@BuntyBru - you can also just use a CSS font-size value because that is basically what you get when you add the additional classes like fa-2x, fa-3x, etc.
BuntyBru
@BuntyBru
Nov 16 2017 13:00
@khaduch
i tried using font size
but it was not working
@Asjas
damn correct Font Awesome needs an update
i am searching for an icon of "speed meter" cannot find it
Ken Haduch
@khaduch
Nov 16 2017 13:01
@BuntyBru - I guess you would have to make sure that it wasn't getting overridden by the font-awesome settings.
@BuntyBru - there is a tachometer icon? At least in the 4.7 version, which is the latest one out there
Michiel
@MichielHuijse
Nov 16 2017 13:34
Why doesn't this return undefined?
function addTogether() {
 var len, sum;
  len = arguments.length;

  // function checks if typeof is number.
  function isNumber(num) {
    if (typeof(num === 'number')) {
      return true;
    } else return undefined;
  }

  // This is the logic part which defines what to do depending on the number of arguments.


  if (len > 1 ){
    if (isNumber(arguments[0]) === true && isNumber(arguments[1]) === true) {
    sum = arguments[0] + arguments[1];
    return sum;
  } 
  else return undefined;
  }

  else {
     var arg1 = arguments[0];

     if (isNumber(arg1) === true) {
       return function(arg2) {
         if (isNumber(arg2) === undefined) {
           return undefined;
         } else {
           sum = arg1 + arg2;
           return sum; 
         }
       };
     } // else arg1 = not a number than:
    else {return undefined; }
   } 
}

addTogether("http://bit.ly/IqT6zt", "2");
Moisés Man
@moigithub
Nov 16 2017 14:01
if (typeof(num === 'number')) {
num === 'number' <-- will be evaluated to a boolean value ... true/false
soo u doing
if(typeof(true) //or typeof(false)
it should BE
if (typeof(num ) === 'number') {
@MichielHuijse
Michiel
@MichielHuijse
Nov 16 2017 14:28
@moigithub thanks, yes sure that is true.
CamperBot
@camperbot
Nov 16 2017 14:28
michielhuijse sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3712 | @moigithub |http://www.freecodecamp.org/moigithub
Michiel
@MichielHuijse
Nov 16 2017 14:28
I have to teach myself i read every piece of code over and over.
BuntyBru
@BuntyBru
Nov 16 2017 14:39

@khaduch thanks for the tachometer

It did not showed on search results while i was searching for"meter"

CamperBot
@camperbot
Nov 16 2017 14:39
buntybru sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3504 | @khaduch |http://www.freecodecamp.org/khaduch
Ken Haduch
@khaduch
Nov 16 2017 14:43
@BuntyBru - wow, you're right! They should improve their search algorithm to use partial words, too. Actually, it looks like it does do that, but for some reason tachometer doesn't show? It is a very strange search. If you type t, it shows some number of icons that begin with t, but not tachometer. If you type ta then it shows tachometer. If you type "meter" it shows nothing... anyway - you're welcome! Hope it works out for you...
BuntyBru
@BuntyBru
Nov 16 2017 15:02
@khaduch
It already worked
i am thinking about adding map location into my weather app
BuntyBru
@BuntyBru
Nov 16 2017 16:56
how do i increase my design skills
https://codepen.io/BuntyBru/pen/MOEMPP
Poor man's weather app
:worried:
shit i forgot to change the image part
Sorin Ruse
@sorinr
Nov 16 2017 16:59
@BuntyBru the app is reporting the right values for my location but you should definitely have still to work on the interface. I would first revise all that margins in hundreds of px
BuntyBru
@BuntyBru
Nov 16 2017 17:00
were you able to see the map?
@sorinr
yeah i am going to look into CSS + bootstrap lectures again
i guess now i have some practical experience
the lectures would work wonder
i believe so
Ken Haduch
@khaduch
Nov 16 2017 17:03
@BuntyBru - I always find that after getting some exposure and experience on a particular topic that you can make a lot more sense out of going back to "class" and getting a second look at it. Good luck!
BuntyBru
@BuntyBru
Nov 16 2017 17:05

@khaduch
two things
first i attached a map in the weather app
which would reflect the user's location mapped on google maps

secondly
any more tips related to make good interfaces

Ashwin
@ashwins93
Nov 16 2017 17:05
@BuntyBru read google's material design guidelines
Alvaro
@minutazos
Nov 16 2017 17:07
ey, anyone knows why when I do a get() with jquery, the other javascripts doesn't works?
after loading the new content
A-J Roos
@Asjas
Nov 16 2017 17:08
You'll have to post a codepen link or jsfiddle for anyone to help you
diegoignacious
@diegoignacious
Nov 16 2017 17:08
Hey everybody!
would somebody help me with a lightbox issue ?
i have a bootstrap template
wich i've edited to my needs
the thing is : bootstrap lightbox came as a col-4-md grid by default
but, i need them as a col-3-md
when i switch the items to col-md-3
Sorin Ruse
@sorinr
Nov 16 2017 17:10
@BuntyBru don't see the map but i think u need an api key when calling the google maps api. its free to obtain
diegoignacious
@diegoignacious
Nov 16 2017 17:10
it doesnt work anymore
Alvaro
@minutazos
Nov 16 2017 17:11
@Asjas the problem is that is an php file not an html :/
diegoignacious
@diegoignacious
Nov 16 2017 17:12
would somebody help me with this please :worried: ?
A-J Roos
@Asjas
Nov 16 2017 17:13
@minutazos There are websites that allow you post code and then share a link. If it's too big to post in here then link to it
the first one is the php (plus the include that i call with the get() ) and the second one is the js
homebrainbox
@homebrainbox
Nov 16 2017 17:18
Hello, when I reduce the size of my screen and click the icon bar or ("hamburger icon"), the expected dropdown menu doesn't appear. Help needed.
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
             <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#mynavbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span> 
             </button>    
                <a class="navbar-brand" href="#">HOMEBRAINBOX</a>
            </div>
          <div class="collapse navbar-collapse" id="mynavbar">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#home">home</a></li>
                <li><a href="#about">about</a></li>
                <li><a href="#portfolio">portfolio</a></li>
                <li><a href="#contact">contact</a></li>
            </ul>
          </div>      
        </div>
    </nav>
A-J Roos
@Asjas
Nov 16 2017 17:19
@homebrainbox The dropbown menu uses jquery and bootstrap js
Is it included?
Chris
@bestintown23
Nov 16 2017 17:20
how can i make my icons and figcaptions show in a row instead of a column on my page? https://codepen.io/bestintown23/pen/bYoqrO
Alvaro
@minutazos
Nov 16 2017 17:21
@Asjas maybe if I put the scripts also in the charged content?
A-J Roos
@Asjas
Nov 16 2017 17:22
@homebrainbox Make sure you have jquery defined first and then bootstrap js. I just copied your code into a codepen and the dropdown works https://codepen.io/asjas/full/OOxKpZ/
Charged content?
Ken Haduch
@khaduch
Nov 16 2017 17:22

@BuntyBru - the weather map is a nice addition! On the weather panel itself, there are a couple issues - there is a text "situation_img" next to the temperature. And the name of my location is 19 characters long, so it overwrites the wind speed value. I would say that in general having large blocks that are a fixed size make for some difficult problems - responsive behavior being one of them, and things like this where the text needs to occupy more space.

But it's looking good in general - coming along. As for design, I don't know what to recommend. THere are so many things out there. I would give @ashwins93 site a look - Google is a good resource for lots of stuff. Someone also recommended a design series to me that I subscribed to but never started really following. The site is https://hackdesign.org/ - I took a look at the first week's lessons and they provide a lot of information. The person who recommended it said that it helped him a lot with design. So I'll just pass it along for you to take a look at. (And anyone else who is familiar with that site and has looked at it could add commentary, that would be appreciated.)

homebrainbox
@homebrainbox
Nov 16 2017 17:26
Alvaro
@minutazos
Nov 16 2017 17:26
@Asjas maybe if I put the scripts also in the charged content?
Or maybe if put the code for the hover and the resize inside the click() function it works, but then, there is no reason to use the get() because what i wanted to do with this is that the charge is minified, and putting it inside the click() function, it will apply the other functions to ALL the images, and that is want to avoid
A-J Roos
@Asjas
Nov 16 2017 17:26
@alvaro Sorry I don't know php. You'll have to wait for someone to see your messages and help you
Alvaro
@minutazos
Nov 16 2017 17:27
well the problem is not in the php but in the jquery and the way it works :P
A-J Roos
@Asjas
Nov 16 2017 17:27
@minutazos okay
Michael Cordero
@CyberPutty
Nov 16 2017 17:27
I'm building the javascript calculator does anyone want to test and see if there are any issues.
A-J Roos
@Asjas
Nov 16 2017 17:28
@homebrainbox Delete bootstrap 4. You are already using bootstrap 3. Second. Please read my previous message where i said the menu uses Jquery. You still haven't inserted it in before bootstrap js
homebrainbox
@homebrainbox
Nov 16 2017 17:29
@Asjas Thank you
CamperBot
@camperbot
Nov 16 2017 17:29
homebrainbox sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @asjas |http://www.freecodecamp.org/asjas
A-J Roos
@Asjas
Nov 16 2017 17:29
I forked your website and fixed the css and js. Go check how it needs to be
homebrainbox
@homebrainbox
Nov 16 2017 17:36
@Asjas Out of curiosity, why do I need to delete Bootstrap 4?
A-J Roos
@Asjas
Nov 16 2017 17:36
@homebrainbox Because you are using bootstrap 3 just above it.
homebrainbox
@homebrainbox
Nov 16 2017 17:37
@Asjas Yes, but it changes the formatting of some of the elements on the page if I do so...
Ken Haduch
@khaduch
Nov 16 2017 17:37
@CyberPutty - it looks pretty nice. I tried a number of calculations and things seemed to work well.
homebrainbox
@homebrainbox
Nov 16 2017 17:37
@Asjas I mean, can I just not use both?
A-J Roos
@Asjas
Nov 16 2017 17:37
Then you need to use a bootstrap 4 navbar. You are using a bootstrap 3 nav menu. You can go to getbootstrap.com and go to the docs and change your html to use bootstrap 4
@homebrainbox Do you really need both? what features does bootstrap 3 have that you cannot use in bootstrap 4?
Bootstrap is a massive library. There is currently very little need to download and use both. They will also clash
Michael Cordero
@CyberPutty
Nov 16 2017 17:40
@khaduch thanks!
CamperBot
@camperbot
Nov 16 2017 17:40
cyberputty sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3505 | @khaduch |http://www.freecodecamp.org/khaduch
homebrainbox
@homebrainbox
Nov 16 2017 17:41

@Asjas It's not about the features, but if I remove Bootstrap 4, the image in the 'About' section when I shrink the screen to medium size is placed under the paragraph and is bigger. With Bootstrap 4 on, the image shrinks and is sitting next to the paragraph.

edit: spelling

@Asjas I prefer the latter.
A-J Roos
@Asjas
Nov 16 2017 17:42
Then you just need to make your website bootstrap 4 compatible by using a bootstrap 4 nav bar and not bootstrap 3. Then you can remove bootstrap 3
homebrainbox
@homebrainbox
Nov 16 2017 17:43
@Asjas So if I understand it correctly, its either or, right?
A-J Roos
@Asjas
Nov 16 2017 17:44
It's preferred yes. Per library it's pretty much 400kb to download if not more. That's double if you use both. And they will definitely clash.
homebrainbox
@homebrainbox
Nov 16 2017 17:45
@Asjas Understood. How much of a palpable impact would using both libraries have in terms of speed, etc.? Is it significant?
A-J Roos
@Asjas
Nov 16 2017 17:45
Yes it will be. It's double the size that is actually needed if you just used 1 instead of 2.
homebrainbox
@homebrainbox
Nov 16 2017 17:46
@Asjas Thank you
CamperBot
@camperbot
Nov 16 2017 17:46
homebrainbox sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
api offline
homebrainbox
@homebrainbox
Nov 16 2017 17:47
@Asjas Thank you very much.
CamperBot
@camperbot
Nov 16 2017 17:47
homebrainbox sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
api offline
ExpressyCode
@ExpressyCode
Nov 16 2017 17:50
Hey does anyone know why my code doesnt console.log the letters? https://codepen.io/TobiasKZ/pen/pdWMBo?editors=0012
A-J Roos
@Asjas
Nov 16 2017 17:54
@TobiasKZ change line 5 to for(var i = 0; i <= arr.length; i++)
If i test i <= arr.length it works. Seems to be exiting too early
ExpressyCode
@ExpressyCode
Nov 16 2017 17:56
@Asjas Awesome! Thanks so much :)
CamperBot
@camperbot
Nov 16 2017 17:56
tobiaskz sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
:cookie: 290 | @asjas |http://www.freecodecamp.org/asjas
BuntyBru
@BuntyBru
Nov 16 2017 17:56

@khaduch
the "situation_img" refers to the image with respect to the weather

in my case it is the following icon
"https://cdn.glitch.com/6e8889e5-7a72-48f0-a061-863548450de5%2F50d.png?1499366021771"
Regarding the wind speed part i think i will move it a bit upwards

@sorinr
i have already entered the key mate
BuntyBru
@BuntyBru
Nov 16 2017 18:02
It is added in the HTML part
homebrainbox
@homebrainbox
Nov 16 2017 18:14
How do you achieve the scroll effect with the first image used on this site? What do you even call it? https://codepen.io/lveent/pen/gaZyaq
J. Hart
@JHart9
Nov 16 2017 18:14
@homebrainbox That’s known as parallax
This may be what you’re looking for! https://www.w3schools.com/howto/howto_css_parallax.asp
homebrainbox
@homebrainbox
Nov 16 2017 18:15
@JHart9 Thank you, I'll do homework. Much obliged.
CamperBot
@camperbot
Nov 16 2017 18:15
homebrainbox sends brownie points to @jhart9 :sparkles: :thumbsup: :sparkles:
:cookie: 253 | @jhart9 |http://www.freecodecamp.org/jhart9
J. Hart
@JHart9
Nov 16 2017 18:15
No prob!
Hope it helps
Radu Matees
@RaduMatees
Nov 16 2017 18:20
hello there :). Could someone please help me a bit to wrap my head around some concepts?
I am referring to callback functions
for instance
~~

function person(name, gender, callback){

N = name.toUpperCase();
G = gender.toUpperCase();
callback(N,G);

}

function show_person(arg1, arg2){

console.log(arg1, arg2);
}

person("Ritchie", "male", show_person)
person("Max", "male", show_person)

this code does the same thing as this

function person(name, gender){

N = name.toUpperCase();
G = gender.toUpperCase();
show_person(N,G);

}

function show_person(arg1, arg2){

console.log(arg1, arg2);
}

person("Ritchie", "male")
person("Max", "male")

function person(name, gender, callback){

 N = name.toUpperCase();
 G = gender.toUpperCase();
 callback(N,G);

}

function show_person(arg1, arg2){

 console.log(arg1, arg2);
}

person("Ritchie", "male", show_person)
person("Max", "male", show_person)
function person(name, gender){

 N = name.toUpperCase();
 G = gender.toUpperCase();
 show_person(N,G);

}

function show_person(arg1, arg2){

 console.log(arg1, arg2);
}

person("Ritchie", "male")
person("Max", "male")
1 vs 2
why should i use callback as an argument in the first place? if i could just call the function directly
is there something I am missing?... or maybe this isn;t the best example
Radu Matees
@RaduMatees
Nov 16 2017 18:27
does it has something to do with the time of execution?... so the call should wait for the first part to be executed, and only after that to execute the callback?... for example, in a real life situation in ajax calls
restrepomich
@restrepomich
Nov 16 2017 18:38
Hey guys, i'm running into a bit of an issue with a script and need some help
<script type="text/javascript">
time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 7
startminute = 30
endhour = 10
endminute = 30

if(hours => starthour && minutes => startminute ) {
location.replace('breakfast-4.html');
}else if(hours > endhour){
location.replace('lunch-4.html');
}


</script>
time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 7
startminute = 30
endhour = 10
endminute = 30

if(hours => starthour && minutes => startminute ) {
    location.replace('breakfast-4.html');
}else if(hours > endhour){
    location.replace('lunch-4.html');
}
I need the breakfast file to start showing at 7:30 am, and switch over to lunch at 10:30am
This is as far as I've gotten. I can't get it to switch
Ken Haduch
@khaduch
Nov 16 2017 18:41
@restrepomich - for starters - this line: if(hours => starthour && minutes => startminute ) { looks like you are using the wrong comparison operator - you might want if(hours >= starthour && minutes >= startminute ) {
restrepomich
@restrepomich
Nov 16 2017 18:43
Ah! I switched those, but now it's on a loop
Ken Haduch
@khaduch
Nov 16 2017 18:44
well, if it's in a loop, how are you starting and stopping this function from executing? You could use something like a setInterval() method to run it once a minute or more frequently? You must have more code than this?
restrepomich
@restrepomich
Nov 16 2017 18:45
I have this in the lunch file
time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 10
startminute = 30
endhour = 7
endminute = 30

if(hours >= starhour && minutes >= starminute ) {
    location.replace('lunch-4.html');
}else if(hours > endhour){
    location.replace('lunch-4.html')
}
Ken Haduch
@khaduch
Nov 16 2017 18:46
I see another typo "starhour" vs "starthour" and "starminute" vs. "startminute"?
restrepomich
@restrepomich
Nov 16 2017 18:49
@khaduch good catch, thank you!
CamperBot
@camperbot
Nov 16 2017 18:49
restrepomich sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3506 | @khaduch |http://www.freecodecamp.org/khaduch
restrepomich
@restrepomich
Nov 16 2017 18:49
I'm wracking my brain trying to figure out where I'm going wrong here. It's stuck on a white screen
Stephen James
@sjames1958gm
Nov 16 2017 18:52
@RaduMatees With AJAX the callback happens at a later time, when the response happens. So yes it is a different case.
For function like array.map(function() {}); the callback function allows you to provide functionality that the map function calls upon when needed.
array.sort is also like this.
Ken Haduch
@khaduch
Nov 16 2017 18:52
@restrepomich - do you have this in a codepen project? I'd be happy to take a look at it if I could see the entire thing? If not a codepen, then maybe you could create it in jsbin or repl.it or somewhere?
Ken Haduch
@khaduch
Nov 16 2017 18:58
@restrepomich - one thing that you could do is check your devtools console in your browser and see if it is flagging any errors.
restrepomich
@restrepomich
Nov 16 2017 18:59
@khaduch for sure! I'll get a codepen set up.
Alvaro
@minutazos
Nov 16 2017 19:06
Hey, I have a problem, I do an ajax get, and after that with some functions i format the charged content, but between the load and the functions, there is a time lapse where we can see the content without formatting, it would be possible to not show the content until its formatted? (ive thinked in hidden() but the content it also occupies space)
Kaz Baig
@kbaig
Nov 16 2017 19:08
@minutazos do you have a pen
Alvaro
@minutazos
Nov 16 2017 19:10
well is a large project, is not for freecodecamp :S and there is some php in the code so i cant upload to codepen, but i can do a pastebin if you want
Chris
@bestintown23
Nov 16 2017 19:11
why is 2 out of 3 of my divs showing in a row? nothing seems to work for me... i need them all in a row https://codepen.io/bestintown23/pen/bYoqrO
Alvaro
@minutazos
Nov 16 2017 19:12
@kbaig https://pastebin.com/9zD8QutW here is the jquery function
https://pastebin.com/ZHB89zhA and here the php loaded
Ken Haduch
@khaduch
Nov 16 2017 19:15
@bestintown23 - if I made the width on your icons1 equal to 32.3% then it moves all three on a line, at least on a wide enough screen. Maybe you should use flex or the CSS grid or something else?
Kaz Baig
@kbaig
Nov 16 2017 19:16
@minutazos not enough to go by there but why don't you just create an element, add styling to it, and then add it to the DOM
Chris
@bestintown23
Nov 16 2017 19:18
@khaduch life saver!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! it worked
thank you so much, now i can continue with my site!! @khaduch
CamperBot
@camperbot
Nov 16 2017 19:18
bestintown23 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3507 | @khaduch |http://www.freecodecamp.org/khaduch
Alvaro
@minutazos
Nov 16 2017 19:19
because i have a masonry and a hover effect (both done with css in a first time) but when i merge them, the style cracks, and I have to do a fix with javascript
Ken Haduch
@khaduch
Nov 16 2017 19:20
@bestintown23 - you're welcome. It seems a bit tenuous to have it be right on the edge of not doing what you want? I think that with flex you could make those align nicely, and be the same size vertically, too? Maybe you don't want to worry about that right now, but it seems like a better way to control the placement of those...
Alvaro
@minutazos
Nov 16 2017 19:20
and I can't do the hover with the selector .item:hover > masonry-bg
Ken Haduch
@khaduch
Nov 16 2017 19:22
@bestintown23 - wow - just putting display: flex; on your #icons selector in your CSS makes it work beautifully!
Alvaro
@minutazos
Nov 16 2017 19:34
@kbaig sorry, I'm was explaining it wrong, the fact is that I get the code, and after i append it, so, it takes some seconds to apply the div style where I append it
Kaz Baig
@kbaig
Nov 16 2017 19:38
@minutazos I understand. I'm saying why not use something like document.createElement or whatever the jquery equivalent is, adding style to it, and then appending the element afterwards
Alvaro
@minutazos
Nov 16 2017 19:45
What i meant before is that the style is created by the js, and when i append it, it takes some secs to run the script that fix the format
thats why doing what you says isn't suitable in this case :S
Kaz Baig
@kbaig
Nov 16 2017 19:50
ah ok
then without being able to play with the code, best i can say is to find an alternative UI solution
Gurpreet SIngh
@Gurpreet3131
Nov 16 2017 21:53
Hi. How can I send a post request to Node js from javascript without any form in HTML
Ken Haduch
@khaduch
Nov 16 2017 21:55
@Gurpreet3131 - I don't know the answer myself, but a search turned up this stackoverflow post with answers
Christopher Brown
@ChrisBrownie55
Nov 16 2017 22:15
@minutazos why is the style created by the js?
Randy
@rdavidson3
Nov 16 2017 22:16
hello coders :)
can I ask someone to help me out?
I'm trying to encode a drop down menu however, it is not working as intended
Christopher Brown
@ChrisBrownie55
Nov 16 2017 22:22
@rdavidson3 could you please post a codepen link
thanks :)
Gurpreet SIngh
@Gurpreet3131
Nov 16 2017 22:24
var item = {
attemptId: attemptId,
manualInput: manualInputCount,
randomInput: randomInputCount
};
var xhr = new XMLHttpRequest();
xhr.open("POST", path, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(item));
I am trying to send a json named item to the node js server from a js file.
The code is displayed above
now how to write the post function in express js to receive this json item??
Christopher Brown
@ChrisBrownie55
Nov 16 2017 22:26
@rdavidson3 I don't know what you're trying to do with all that data-toggle and aria-labelledby stuff but if you want to create a dropdown menu you should use a checkbox and css styling to achieve your goal.
@rdavidson3 Here's a link to a tutorial
Randy
@rdavidson3
Nov 16 2017 22:28
I was aiming to have the dropdown menu toggle once clicked into and the aria labelledby tag is to associate the Id of the same name to the <li> >.<
thanks for the help @ChrisBrownie55
CamperBot
@camperbot
Nov 16 2017 22:28
rdavidson3 sends brownie points to @chrisbrownie55 :sparkles: :thumbsup: :sparkles:
:cookie: 274 | @chrisbrownie55 |http://www.freecodecamp.org/chrisbrownie55
tyjanii
@tyjanii
Nov 16 2017 22:43
hello, where can i get HD images for my webpage please??
i used to know what site to go to but i haven't been coding for a while so i kinda forgot
help?? anybody???
Tom
@moT01
Nov 16 2017 22:53
do a search, i dont know
Darshan
@Dave1089
Nov 16 2017 22:55
@tyjanii Pexels
Christopher Brown
@ChrisBrownie55
Nov 16 2017 22:58
@tyjanii Codepen has an assets feature built right in to the editor so you can get hd images from there to use in your projects
Ken Haduch
@khaduch
Nov 16 2017 23:03
@ChrisBrownie55 - I think that this is only if you have a paid service on CodePen, not the free version? Unless I've missed something...
@tyjanii - ^^^
Christopher Brown
@ChrisBrownie55
Nov 16 2017 23:04
Nope
It's you can upload if you have paid
Anyone can use it
Just click the image you want and it copies the link to it into your clipboard
@khaduch No paid required, it's pretty cool
Ken Haduch
@khaduch
Nov 16 2017 23:08
@ChrisBrownie55 - it looks like a limited selection of images there? But they do have a link to unsplash.com, which is a source of free images. Or maybe not - I guess you use unsplash in conjunction with that search. Nice to know about that - thanks for sharing the information!
CamperBot
@camperbot
Nov 16 2017 23:08
khaduch sends brownie points to @chrisbrownie55 :sparkles: :thumbsup: :sparkles:
:cookie: 275 | @chrisbrownie55 |http://www.freecodecamp.org/chrisbrownie55
Christopher Brown
@ChrisBrownie55
Nov 16 2017 23:08
You're welcome @khaduch
juni
@junipberry
Nov 16 2017 23:28
do you guys know where I can upload mp4 videos less than a minute long
want to link a video link to my codepen
Ever Lord
@ev3rlord
Nov 16 2017 23:36
@junipberry you can use github
juni
@junipberry
Nov 16 2017 23:37
hi everlord, yes that seems to be so..someone mentioned that yesterday but Ive been having trouble using github to do that
mainly bc Im not very experienced w it
so I was wondering if anyone knew of a simple host site I can use to first finish off this project w
restrepomich
@restrepomich
Nov 16 2017 23:38
Hey guys, could I get an extra pair of eyes to look over my code? I'm trying to get these two files to switch based on the time, but I'm stuck at a loop
Ever Lord
@ev3rlord
Nov 16 2017 23:39
@junipberry i can show you how to start with github
restrepomich
@restrepomich
Nov 16 2017 23:39
I want the breakfast file to show from 7:30 to 10:30, and then at 10:30 for the file to switch to lunch.
A-J Roos
@Asjas
Nov 16 2017 23:41
@junipberry Hi, yeah that was me :). I don't actually know of any free hosting sites for videos. I think vimeo has a free plan? Allows only for small data usage amounts but seems it would fit
A-J Roos
@Asjas
Nov 16 2017 23:48
@junipberry Here is a Codepen with a short video that I downloaded and uploaded to github. You can check how the url looks that i'm using. If you do decide to use github you need to make sure the URL starts with https://raw.githubusercontent.com which is the raw link.
Tom
@moT01
Nov 16 2017 23:48
@restrepomich i dont see a loop
i would maybe use setInterval
restrepomich
@restrepomich
Nov 16 2017 23:49
@moT01 when I open the file in Chrome it loops
Tom
@moT01
Nov 16 2017 23:50
whats it saying or doing
Ken Haduch
@khaduch
Nov 16 2017 23:53
@restrepomich - okay, when you load the page, I think that it's toggling between the two pages, most likely - I think that the thing that you have to do is stop the process somehow - detect that you are already on the breakfast or lunch page if you're supposed to be there and don't do the location.replace() call... Maybe you can get the title of the page and determine from that which one you are on?
restrepomich
@restrepomich
Nov 16 2017 23:53
The loading icon on the chrome tab is spinning out of control
Hmmmm
Ken Haduch
@khaduch
Nov 16 2017 23:54
well, maybe not toggling, just loading over and over and over again. You should be able to test for something on the page, like the title value, and then if you're on the right page, don't load it again?
restrepomich
@restrepomich
Nov 16 2017 23:55
Yep, it's definitely reloading over and over again. I have a title set, but I'm not able to see it since the loop is going so fast between both files.
I'm wondering if my time values are off
Tom
@moT01
Nov 16 2017 23:56
what if you just switch pages at a specific time
instead of a time >= something
Ken Haduch
@khaduch
Nov 16 2017 23:56
@restrepomich - you can just put a variable in your script, since you have two different pages, and put the word "lunch" in one and "breakfast" in the other. Then just test that directly...
restrepomich
@restrepomich
Nov 16 2017 23:56
time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 10

startminute = 30
endhour = 7
endminute = 30

if(hours >= starthour && minutes >= startminute) {
    location.replace('lunch-4.html');
} else if(hours >= endhour && minutes >= endminute){
location.replace('breakfast-4.html')

}

Tom
@moT01
Nov 16 2017 23:56
maybe >7 && < 7:00:05
restrepomich
@restrepomich
Nov 16 2017 23:57
that's the lunch one
and this is the breakfast one
 time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 7

startminute 30
endhour = 10
endminute = 30

if(hours >= starthour && minutes >= startminute) {
    location.replace('breakfast-4.html');
} else if (hours >= endhour && minutes >= endminute){
location.replace('lunch-4.html')

}

Ken Haduch
@khaduch
Nov 16 2017 23:58

@restrepomich - just do something like this - I cannot edit your project to see if it will work:

var thisIs = "lunch";
if(hours >= starthour && minutes >= startminute && thisIs != "lunch") {
    location.replace('lunch-4.html');
}

That way you have a way to prevent the reload.

and, BTW, you should declare your variables with the var keywords, too... :)
restrepomich
@restrepomich
Nov 16 2017 23:59
Let me test this out :)!